Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Range using a variable
I am using a For-Next loop to step through several rows of excel data. I
have set i to be the variable for the row number. When a given set of data meets the criteria I have defined with an If-Then statement I would like to select a Range of data in that row. My question is how do I select this range? (Ex: ActiveSheet.Range("Ai:Di").Select obviously does not work. How do I code the Range statement to select the cells between columns A and D of row variable i?) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Range using a variable
Range("A" & i & ":D" & i).Select
HTH Charles Chickering Chris wrote: I am using a For-Next loop to step through several rows of excel data. I have set i to be the variable for the row number. When a given set of data meets the criteria I have defined with an If-Then statement I would like to select a Range of data in that row. My question is how do I select this range? (Ex: ActiveSheet.Range("Ai:Di").Select obviously does not work. How do I code the Range statement to select the cells between columns A and D of row variable i?) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Range using a variable
activesheet.range("a" & I).resize(1,4).select
or activesheet.cells(i, "a").resize(1,4).select could be used, too. Chris wrote: I am using a For-Next loop to step through several rows of excel data. I have set i to be the variable for the row number. When a given set of data meets the criteria I have defined with an If-Then statement I would like to select a Range of data in that row. My question is how do I select this range? (Ex: ActiveSheet.Range("Ai:Di").Select obviously does not work. How do I code the Range statement to select the cells between columns A and D of row variable i?) -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
selecting Variable range | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Selecting a variable range | Excel Programming | |||
Selecting a variable Range | Excel Programming | |||
Selecting a Range Using a Variable | Excel Programming |