Column numbering instead of letters

  • Thread starter Thread starter grahammal
  • Start date Start date
G

grahammal

In the following visual basic entry I have selected cell "D8" on
Sheet1.
Sheets("Sheet1").Select
Range("D8").Select
If my columns are numbered, how do I reference this cell.
It was column D row 8 but is now column 4 row 8.
I need this information to run a program with some For.... Next loops.
 
Good afternoon grahammal

Why not just change it back.
Go to Tools > Options, General, Settings and uncheck the R1C1 Reference
Style box.

HTH

DominicB
 
Hi Graham

You don't have to change your column titles to increment the cells.
Does the code below help. This will place an incrementing number i
each cell in row 1 using a For ... Next loop.

Sub Test()
Range("A1").Select
For n = 1 To 255
ActiveCell.Offset(, n).Value = n
Next n
End Sub

HTH

Dominic
 
Back
Top