Macro Help CONT 2003


Neil Holden

Not sure if you got this reply Jacob?

i have created 4 sheets and a test sheet.

In the test sheet I have a list of the 4 sheets to copy?

Is this correct?

Neil, try the below

Sub Macro()

Dim wb1 As Workbook, wb2 As Workbook
Dim ws As Worksheet, lngRow As Long, intCount as Integer

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
Set wb2 = Workbooks.Open("c:\1.xls")
Set ws = wb2.Sheets("Sheet1")

For intCount = 1 to 4
lngRow = ws.Cells(Rows.Count, "A").End(xlUp).Row
wb1.Sheets("Test " & intCount).Range("A21:S81").Copy ws.Range("A" & lngRow+1)

wb2.Close True
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub

Jacob Skaria

Hi Neil

No. The below code actually add (copy) data from A21:S81 of sheets 'Test 1',
'Test 2' etc; of the active workbook to an external workbook Sheet1.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question