Using Columns().Row() To create a range

  • Thread starter Thread starter Wandering Mage
  • Start date Start date
W

Wandering Mage

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!
 
Hi
try
range(cells(start_row,start_col),cells(end_row,end_col)).select
 
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



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top