Adding to cell ranges

M

Mike

Have this so far:

Dim CellRng as String
CellRng = "C4"

PercentVal = Sheets("Sheet1").Range(CellRng).Value

***Now, how can I add 1 row to CellRng. It's in loop, and I want it to get
the value for C5 next time.
 
G

Gary''s Student

I am guessing you want to go from "C4" to "C5" to "C6", etc.
change
PercentVal = Sheets("Sheet1").Range(CellRng).Value
into
i = 3
j = 4
..
..
..
PercentVal = Sheets("Sheet1").Cells(j,i).Value

and then increment j in the loop to move downward.

An alternative is to use OFFSET()
 

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