PDA

View Full Version : How to make a range dynamic?



mahras
06-09-2007, 11:30 AM
Hey guys,

Stumbled on this forum while trying to google up an answer for a problem I am having.

Basically I want to make a range dynamic.

For example, what I have is that:

For i = 1 to 100
Range((2+i,3),(2+i+5,3))
Next i

However, excel does not read this properly as you can't use equations as cell values when using range. So is there a way to go around that. I am trying to find the max value in a range of cells and its being a real pain to figure this out.

Would greatly appreciate any assistance. Thanks.

Bob Phillips
06-09-2007, 11:40 AM
Range(Cells(2+i,3),Cells(2+i+5,3))

lucas
06-09-2007, 11:42 AM
take a look at offset in the help files.....
If you show us what your doing it would help to understand the problem.

lucas
06-09-2007, 11:43 AM
well that's just me...

mahras
06-09-2007, 12:14 PM
Thanks a ton lucas and xld! xld> Your code did the trick. Should have realized that cells would have added the values into the range. I will try to post up more details of the project when I ask for help again :).