non alphanumerical character code in Excel

Q52. I have to enter non alphanumeric characters in a cell using VBA - how can I get their codes for use in VBA?

For example, I want to enter a line break into a cell value using VBA. For that I would like to know the ASCII Character code for line break - how can I get the code from Excel?

To do it in Excel, here is the answer:

a) Click on a blank cell and then press "Alt + Enter" to enter a line break as shown below.

excel non alphanumerical character code

b) To get the code for line break enter =CODE(A3) in a cell since line break has been introduced in cell A3. ASCII Value of line break is returned by the formula which can then be used in VBA.

excel excel non alphanumerical character code

 

You can find similar Excel Questions and Answer hereunder

1) Vlookup to return max value from multiple hits in Excel

2) How can I calculate values applying complex Engineering formulas using Excel?

3) How can I create dependent drop down lists?

4) How can I have text autocomplete by typing in a short code for the text?

5) How can I find the count of records that meet a given condition in my raw data table?

6) Sumifs with date range as criteria in Excel

7) How can I extract file name from a full path including folder path and file name?

8) How can I add a background image to a worksheet?

9) How can I prevent users from seeing / accessing my macro code?

10) Is there a way I can round the sales figure to the nearest 500?

11) How can I set non-contiguous print area using VBA?

12) Find and count instances of a character in a string in Excel

13) How can I remove all nonprintable characters from text?

14) Vba code to password protect workbook in Excel

15) Formula converts date to quarter and year in Excel