Dear Excel Forum,
The is the line of code I am using to copy the tab "PE Master" to the workbook I am currently in.
Workbooks("Profit Template.xlsm").Worksheets("PE Master").Range("A1:K200").Copy Destination:=Range("A1")
When I run the code, Excel opens a window and is looking for me to select the file "Profit Template.xlsm". After I select the file, It then copies the tab "PE Master" into the file I am in. How can I have this process done without Excel expecting me to select the file. I have used similar code before in other Macros and never had any problems (i.e., it copies without requesting that I select the file).
Also, when I copied the full path of the file: Workbooks("G:\BusUnits\Finance\USPR\Work Folder\Profit Template.xlsm").Worksheets("PE Master").Range("A1:K200").Copy Destination:=Range("A1")
I get a subscript out of error 9 message.
I've looked at it and can't figure out what is going on. Any help would be greatly appreciated.
The is the line of code I am using to copy the tab "PE Master" to the workbook I am currently in.
Workbooks("Profit Template.xlsm").Worksheets("PE Master").Range("A1:K200").Copy Destination:=Range("A1")
When I run the code, Excel opens a window and is looking for me to select the file "Profit Template.xlsm". After I select the file, It then copies the tab "PE Master" into the file I am in. How can I have this process done without Excel expecting me to select the file. I have used similar code before in other Macros and never had any problems (i.e., it copies without requesting that I select the file).
Also, when I copied the full path of the file: Workbooks("G:\BusUnits\Finance\USPR\Work Folder\Profit Template.xlsm").Worksheets("PE Master").Range("A1:K200").Copy Destination:=Range("A1")
I get a subscript out of error 9 message.
I've looked at it and can't figure out what is going on. Any help would be greatly appreciated.
Last edited: