Using U+2191 character in Excel VBA

amthorpe2000

New Member
Joined
Aug 29, 2009
Messages
8
I have a list of headers that include ↑ (U+2191) in them, I want to write a formula in Excel VBA to do something when a cell contains this as the first character. However I can't seem to include it in the formula it just shows ?

e.g.
VBA Code:
.FormulaR1C1 = "=IF(LEFT(RC[-8],1)=""?"","""",RC[-19])"

what I need is something that will give
VBA Code:
.FormulaR1C1 = "=IF(LEFT(RC[-8],1)=""↑"","""",RC[-19])"

any suggestions.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
It looks like I added an unnecessary step in the solution I offered in that referenced link.

The ChrW function simply requires a Long, which can be specified as a literal in the form of a decimal value, hexadecimal value, or octal value. So the following refer to the same character...

VBA Code:
ChrW(8593)  'decimal value

ChrW(&H2191) 'hexadecimal value

ChrW(&O20621) 'octal value

Therefore, I think you can simply do the following...

VBA Code:
.FormulaR1C1 = "=IF(LEFT(RC[-8],1)=""" & ChrW(&H2191) & ""","""",RC[-19])"

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top