Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Editing a for each next loop
You can test for empty in the loop:
Sub PasteData() Dim r As Range For Each r In Worksheets("Makron").Range("B6:B14") If IsEmpty(r.Value) Then Exit For End If GetPortfolioData Portfolio:=r.Value Next End Sub -- Gary''s Student "sverre" wrote: Hi How do I instead of selecting the range B6:Bb14 below tell excel to loop starting from b6 and continue down till the cell in col B is empty? ?Sub PasteData() Dim r As Range For Each r In Worksheets("Makron").Range("B6:B14") GetPortfolioData Portfolio:=r.Value Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
For Each ... Next loop - need to reference the loop variable | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |