Thread: Loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Loop

Sub demo()
Workbooks("File2.xls").Activate
Sheets("Sheet1").Activate
For i = 1 To Rows.Count
If IsEmpty(Cells(i, "B")) Then
Exit For
End If
Next
i = i - 1

Set r2 = Range("A1:A" & i)
Set r1 = Workbooks("File1.xls").Sheets("Sheet1").Range("C6" )

r1.Copy r2
End Sub

--
Gary''s Student - gsnu200731