Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have a fairy easy question but I can't find the correct answer: I have 2 excelsheets File1.xls and File2.xls On File1.xls there is one cell (C6) that I want to copy to file2.xls in Range A if there is a value in Range B from file2.xls So I need to create a loop function but I can't find the right one. Can anyone help me with this? Thanks! BR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sometimes you don't have to loop:
Dim wks1 as worksheet dim wks2 as worksheet dim LastRow as long set wks1 = workbooks("file1.xls").worksheets("sheet999") set wks2 = workbooks("file2.xls").worksheets("sheet888") with wks2 lastrow = .cells(.rows.count,"B").end(xlup).row .range("a1:A" & lastrow).value = wks.range("c6").value end with Frank wrote: Hi All, I have a fairy easy question but I can't find the correct answer: I have 2 excelsheets File1.xls and File2.xls On File1.xls there is one cell (C6) that I want to copy to file2.xls in Range A if there is a value in Range B from file2.xls So I need to create a loop function but I can't find the right one. Can anyone help me with this? Thanks! BR -- Dave Peterson |
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 |