joycesolomon
New Member
- Joined
- Aug 2, 2011
- Messages
- 48
Hi,
I am using the below code to do the copy of one sheet from workbook A to workbook B, for some reason the records are multiplied, can someone tell me what is the error in this code
Dim N%
Application.ScreenUpdating = False
On Error Resume Next '<< error is - "books already open"
Workbooks.Open Filename:="C:\Documents and Settings\jssolomo\Desktop\A.xls"
For N = 1 To Sheets.Count
Workbooks("A.xls").Activate
Sheets("TASK" & N).Select
Range("A3", Range("A65536").End(xlUp).Rows.EntireRow).Select
Selection.Copy
Windows("Reporting.xls").Activate
Sheets("QueryA").Activate
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Next
Workbooks("A").Close
Range("A1").Select
thanks
I am using the below code to do the copy of one sheet from workbook A to workbook B, for some reason the records are multiplied, can someone tell me what is the error in this code
Dim N%
Application.ScreenUpdating = False
On Error Resume Next '<< error is - "books already open"
Workbooks.Open Filename:="C:\Documents and Settings\jssolomo\Desktop\A.xls"
For N = 1 To Sheets.Count
Workbooks("A.xls").Activate
Sheets("TASK" & N).Select
Range("A3", Range("A65536").End(xlUp).Rows.EntireRow).Select
Selection.Copy
Windows("Reporting.xls").Activate
Sheets("QueryA").Activate
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Next
Workbooks("A").Close
Range("A1").Select
thanks