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

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

0
11/20/2005 2:35:46 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
309 Views

Similar Articles

[PageSpeed] 31

You may be able to use R1C1 terminology, but you'll need to get someone else 
to help from here.

"cyberdude" <honchorlee@gmail.com> wrote in message 
news:1132454146.072442.73790@g43g2000cwa.googlegroups.com...
> 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
> 


0
reply6075 (299)
11/20/2005 2:47:49 AM
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)



cyberdude wrote:
> 
> 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

-- 

Dave Peterson
0
petersod (12005)
11/20/2005 3:28:18 AM
Reply:

Similar Artilces: