View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Increasing a range in a loop

Something like

Dim myRange As Range
Dim i As Long


Set myRange = Range("A1:Z5")
For i = 1 To 5
Set myRange = myRange.Offset(1, 0)
'...
Next

but you can just as easily set it afetr with

Dim myRange As Range
Dim i As Long

Set myRange = Range("A1:Z5")
For i = 1 To 5
Set myRange = myRange.Offset(1, 0)
'...
Next

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"ric" wrote in message
...
Is there a way to increase a range in a loop?

So "A1:Z5" would become "A6:Z10".

Regards

Ric