Changing file name in recorded macro

Copper Contributor

I recorded the following code to copy a worksheet that will be the new standard layout into an existing file. The item I have in bold is the file name that will change each time.  Thanks in advance!

 

Sub CopyWorksheet()
'
' CopyWorsheet Macro
'
' Keyboard Shortcut: Ctrl+Shift+W


Sheets("Sheet1").Select
Sheets("Sheet1").Copy Before:=Workbooks("5011 CHS REV B.xlsx").Sheets(1)
Sheets("Sheet1 (2)").Select
Windows("2021 MASTER SPRINGING SPEC.xlsx").Activate
End Sub

0 Replies