Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code which automatically copies and pastes data off all workbooks
(1 sheet each) in a folder. How about if I want to make it cycle through multiple worksheets within a workbook before closing it? I made a few modifications to this loop, but it is not working. Anyone know why? Do While sFil < "" Workbooks.Open sPath & sFil For Each w In ActiveWorkbook.Worksheets <---added this With ThisWorkbook.Worksheets("Bulk") <---and this k = ThisWorkbook.Sheets(1).Range("A65536").End(xlUp).R ow n = k + 4 Set oWbk = Workbooks.Open(sPath & "\" & sFil) Range("B4:Z1000").Copy Set w = ThisWorkbook.Sheets(1) ThisWorkbook.Sheets(1).Range("A" & n).PasteSpecial End With <---added this Next w <---and this oWbk.Close True <--should this be False I appreciate your help as always. Arlen |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shortcut key to cycle through worksheets in the same workbook | Excel Discussion (Misc queries) | |||
Cycle through worksheets and sum | Excel Programming | |||
How do I cycle through all of the worksheets | Excel Discussion (Misc queries) | |||
Cycle through all worksheets | Excel Programming | |||
Cycle thru worksheets in a workbook | Excel Programming |