A
Arlen
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).Row
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
(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).Row
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