Can the column index in a cell address be made variable?

  • Thread starter Thread starter cyberdude
  • Start date Start date
C

cyberdude

Hi,


To refer to a cell with a variable row number, we can just code it as,
for example,


Dim i As Interger
i=234
Range("A" & i).Select


To refer to a cell with a variable column index, it seems not that easy

because the column
index must be explicitly specified in a cell address. So, if I want to

go to the j th column on the 2nd row or j columns to the right of cell
AA3, is there a quick and easy way to do it? Thank you in advance.


David
 
You may be able to use R1C1 terminology, but you'll need to get someone else
to help from here.
 
dim myCell as range
set mycell = activesheet.range("aa3")
mycell.offset(x,y).select

x = number of rows (positive=down,negative=up,0=same row)
y = number of columns (positive=right,negative=left,0=same column)
 
Back
Top