Why isn't my VBA code running?

DavyJones90

Board Regular
Joined
Feb 23, 2022
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Hey guys and thanks in advance, this is my code

VBA Code:
For Each Cl In .Range("F6", .Range("F" & Rows.Count).End(xlUp))
            If Dic.exists(Cl.Value) Then Cl.Offset(25, 4).Value = Dic(Cl.Value)
            If Cl.Value = ChrW(2197) Then Cl.Offset(26, 0).Value = "RANGE-Reverse All Arrows to " + ChrW(2191)
        Next Cl

The first part works perfectly, It basically take a value off a different sheet, compares that another value exists and if it does offsets the dictionary value in a certain field.

The second part does nothing. basically, the values are arrows, which I cannot display in VBA, so I wanted to use the hex code (I also tried the same with &H).

Any idea what I am dooing wrong?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Code:
If Cl.Value = ChrW(&H2197)

If that still doesn't work, try using the immediate window to check ?worksheetfunction.dec2hex(worksheetfunction.Unicode(Range("F6"))) to ensure it returns 2197. If not, you have a different Unicode character than 2197 in cell F6.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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