Selecting a Range using a variable

G

Guest

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?)
 
D

Dave Peterson

activesheet.range("a" & I).resize(1,4).select
or
activesheet.cells(i, "a").resize(1,4).select

could be used, too.
 

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

Top