Change these column refs from letters to numbers

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,212
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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,226,116
Messages
6,189,057
Members
453,523
Latest member
Don Quixote

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