{"id":500,"date":"2018-06-28T11:30:11","date_gmt":"2018-06-28T11:30:11","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=500"},"modified":"2024-03-29T15:55:39","modified_gmt":"2024-03-29T15:55:39","slug":"chr-34","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/vba\/chr-34\/","title":{"rendered":"Chr 34 in VBA"},"content":{"rendered":"\n
CHR<\/strong> is the VBA function and returns the character from the ASCII table.<\/p>\n\n\n\n For example, Chr(34)<\/strong> returns the 34th character, which is the \u201c sign (double quotes).<\/p>\n\n\n\n Look at this example. Let\u2019s say that you want to insert the following name into the cell using the VBA<\/strong> code.<\/p>\n\n\n\n Edwin \u201cBuzz\u201d Aldrin<\/strong><\/p>\n\n\n\n You can use one of the two methods.<\/p>\n\n\n\n To illustrate how you can Execute the following macro inside a cell, use this formula.<\/p>\n\n\n\n Both examples will display the name in double quotes.<\/p>\n\n\n\nExample:<\/h3>\n\n\n\n
\n
Sub InsertText()\n ActiveCell.Value = \"Edwin \" & Chr(34) & \"Buzz\" & Chr(34) & \" Aldrin\"\nEnd Sub<\/pre>\n\n\n\n