Hi Arlen
See
http://www.rondebruin.nl/fso.htm
Or use the add-in
http://www.rondebruin.nl/merge.htm
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Arlen" <(E-Mail Removed)> wrote in message news:B14ACA27-4676-422D-99E4-(E-Mail Removed)...
>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
>
>
>