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! |
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! |
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! . |
All times are GMT +1. The time now is 11:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com