How do you reference columns in excel by a number.
Case in point:
do while x < 10
range("A1", 5).value = x
x = x+1
loop
I need to increment that A1 to B1 and then C1 and so on.
Any help?
Steve
Printable View
How do you reference columns in excel by a number.
Case in point:
do while x < 10
range("A1", 5).value = x
x = x+1
loop
I need to increment that A1 to B1 and then C1 and so on.
Any help?
Steve
Hi,
Just some information.
If you intend to get a
responce you probably
should put everyone
down than ask the question.
A hint.
Just a quick idea....
U have to fix a bit
li_Counter = 1
Do While li_Counter < 10
Debug.Print UCase(Chr(65 + li_Counter)) & "1"
range(UCase(Chr(65 + li_Counter)) & "1",5).value = x
li_Counter = li_Counter + 1
Loop
U may have to add the chr value for the quot mark around
If you just want to move over one column at a time, use the R1C1 reference style in your programming.
Evan:
For what it's worth, it's called "Child Psychology"
The best way to reference cells in Excel using row and columns, use Cells(Your Row, Your Column).Select
This question is elementary, don't even need a VB master to answer it.