Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Columns().Row() To create a range
Columns(13 + CurNumOfVer & ":" & 13 + CurNumOfVer +
newversions).Rows(startrowTO & ":" & startrowTO + endrow - startrowFROM) This is what I am using in a macro. I want to use it like this For Each Cell In (above statement) The variables are correct, they are not important. What I am looking to do is create a range object so the for loop can work. The start and stop row and columns are always variable in the macro however. I believe if I were to have a constant I could go Columns("1:2").Rows("3:4"), for instance, and the for loop would function properly. Is there a way for me to easily declare a range with the variable stop/start columns and start/stop rows? Any help is, as always, very much appreciated. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Columns().Row() To create a range
Hi
try range(cells(start_row,start_col),cells(end_row,end _col)).select -- Regards Frank Kabel Frankfurt, Germany Wandering Mage wrote: Columns(13 + CurNumOfVer & ":" & 13 + CurNumOfVer + newversions).Rows(startrowTO & ":" & startrowTO + endrow - startrowFROM) This is what I am using in a macro. I want to use it like this For Each Cell In (above statement) The variables are correct, they are not important. What I am looking to do is create a range object so the for loop can work. The start and stop row and columns are always variable in the macro however. I believe if I were to have a constant I could go Columns("1:2").Rows("3:4"), for instance, and the for loop would function properly. Is there a way for me to easily declare a range with the variable stop/start columns and start/stop rows? Any help is, as always, very much appreciated. Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Columns().Row() To create a range
THANK YOU! That is what I am looking for!
-----Original Message----- Hi try range(cells(start_row,start_col),cells (end_row,end_col)).select -- Regards Frank Kabel Frankfurt, Germany Wandering Mage wrote: Columns(13 + CurNumOfVer & ":" & 13 + CurNumOfVer + newversions).Rows(startrowTO & ":" & startrowTO + endrow - startrowFROM) This is what I am using in a macro. I want to use it like this For Each Cell In (above statement) The variables are correct, they are not important. What I am looking to do is create a range object so the for loop can work. The start and stop row and columns are always variable in the macro however. I believe if I were to have a constant I could go Columns("1:2").Rows("3:4"), for instance, and the for loop would function properly. Is there a way for me to easily declare a range with the variable stop/start columns and start/stop rows? Any help is, as always, very much appreciated. Thanks! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a Range Name? | New Users to Excel | |||
How do I create automatic columns | Excel Discussion (Misc queries) | |||
Create four columns out of one | Excel Discussion (Misc queries) | |||
Create stacked columns chart but with 2 columns for each x axis? | Charts and Charting in Excel | |||
NEED TO CREATE 4 COLUMNS UNDER SIX | Excel Programming |