Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have got a question i can't find he I have to files: File1.xls and File2.xls In file1.xls there is a Cell (C6) that has a value I want to copy to File2.xls in Column A as long there is a value in Column B of File2.xls I need to do a loop but i can't get the correct code for it. Can someone help me with this? Thanks! BR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
(Complex) Loop within loop to create worksheets | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming |