torourke17
New Member
- Joined
- Jan 12, 2018
- Messages
- 12
- Office Version
- 365
- 2019
- Platform
- Windows
Hello, need a little help, hopefully it's relatively easy. I currently have a code that saves my workbook to a specific folder I designated, naming the file based off a cell value. Unfortunately once I click the button to run the Macro it saves the current workbook to that location. I would prefer that it saves a copy to the pathway, keeping my 'active' workbook untouched and also closes the copy that was made. Below is the code I've been using.
Sub filename_cellvalue()
Dim Path As String
Dim filename As String
Path = "G:\xxx\yyy\bbb\etc"
filename = Range("B162")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsm", FileFormat:=52
End Sub
Sub filename_cellvalue()
Dim Path As String
Dim filename As String
Path = "G:\xxx\yyy\bbb\etc"
filename = Range("B162")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsm", FileFormat:=52
End Sub