Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to increase a range in a loop?
So "A1:Z5" would become "A6:Z10". Regards Ric |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Tester11()
Dim rng As Range, rng1 as Range Dim i as Long Set rng = Range("A1:Z5") For i = 1 To 5 Set rng1 = rng.Offset((i - 1) * 5, 0) MsgBox rng1.Address Next End Sub -- Regards, Tom Ogilvy "ric" wrote in message ... Is there a way to increase a range in a loop? So "A1:Z5" would become "A6:Z10". Regards Ric |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cheers bob.
Ric "Bob Phillips" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cheers Tom.
Ric "Tom Ogilvy" wrote in message ... Sub Tester11() Dim rng As Range, rng1 as Range Dim i as Long Set rng = Range("A1:Z5") For i = 1 To 5 Set rng1 = rng.Offset((i - 1) * 5, 0) MsgBox rng1.Address Next End Sub -- Regards, Tom Ogilvy "ric" wrote in message ... Is there a way to increase a range in a loop? So "A1:Z5" would become "A6:Z10". Regards Ric |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop through last cell/row of used range | Excel Discussion (Misc queries) | |||
Pivot Tables-Source Range continually increasing | Excel Worksheet Functions | |||
Increasing the Source Data range for an existing Pivot Table | Excel Worksheet Functions | |||
Increasing a range of grades available | Excel Worksheet Functions | |||
3 range criteria for Loop | Excel Programming |