P
portroe
anybody an idea why I receive a run time error with the below code,?
Sub copy()
Windows("book_master.xls").Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Workbooks(newWorkBook).Activate
Range("A1").Select
ActiveSheet.Paste
End Sub
I have declared the workbook as a variable
Public newWorkBook As Excel.Workbook
thanks
portroe
Sub copy()
Windows("book_master.xls").Activate
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Copy
Workbooks(newWorkBook).Activate
Range("A1").Select
ActiveSheet.Paste
End Sub
I have declared the workbook as a variable
Public newWorkBook As Excel.Workbook
thanks
portroe