I am using the following code to copy a worksheet from one workbook to another, but keep receiving a "Subscript out of range" error. I have double checked the names of the worksheets and they are correct. Any ideas?
Error occurs on this line: "Workbooks("SourceWbk").Sheets("Log (2)").Copy After:=Workbooks("DestWbk").Sheets("Menu")Code:Sub COPY_FROM_MainSched_TO_DoorSched() Dim SourcePath, DestPath, SourceFile, DestFile As String 'set variables SourcePath = "H:\schedule\" DestPath = "H:\shared_tools\" SourceFile = "Cabot, S.xls" DestFile = "door_inventory.xls" SourceWbk = SourcePath & SourceFile DestWbk = DestPath & DestFile Range("A1").Select Application.DisplayAlerts = False Application.ScreenUpdating = False Workbooks.Open Filename:=SourceWbk Workbooks("SourceWbk").Sheets("Log (2)").Copy After:=Workbooks("DestWbk").Sheets("Menu") Windows(DestWbk).Activate End Sub




Reply With Quote