Change these column refs from letters to numbers

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
HI Everyone,

I need to change these column refs from Letters to numbers but just cant get it right.

please help

the code its in is

Code:
   Dim r As Range
  Set r = Intersect(Target, [AB14:AB214,AG14:AG214,AL14:AL214,AQ14:AQ214,AV14:AV214,BA14:BA214,BF14:BF214,BK14:BK214,BP14:BP214])
  If r Is Nothing Then Exit Sub
  If r.Cells.Count <> 1 Then Exit Sub

So I need each Range to be column numbers instead of letters so

AB14:AB214 = Column 28 Row 14 : Column 28 Row 214

Please help if you can

Thanks

Tony
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Re: Help, I need to change these column refs from letters to numbers???

MsgBox Columns("AB").Column

etc.
 
Upvote 0
Re: Help, I need to change these column refs from letters to numbers???

Hi Thanks Kalak,
I'll give that a try and see if it works for me :-)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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