Ottsel
Board Regular
- Joined
- Jun 4, 2022
- Messages
- 174
- Office Version
- 365
- Platform
- Windows
I'm using a userform that has an option to Save a copy of the current workbook, but to give the user the option to hit save in the window themselves.
I don't have much, but in my UserForm I was going with this approach:
I also have 2 ComboBoxes that lists the Month and the Year, so I'd like to have it prefill the Filename with:
"Name of File " & ComboBox_Month & " " & ComboBox_Year
Resulting in: "Name of File April 2023.xlsm"
But, I'm struggling to figure out the correctly way go about it.
Any tips, tricks or advice would be greatly appreciated!
I don't have much, but in my UserForm I was going with this approach:
VBA Code:
Private Sub Export_Click()
Dim Path As String
Path = "G:\MyFolder\Prior_Months"
ChDir Path
ActiveWorkbook.SaveAs Filename:="G:\MyFolder\Prior_Months", FileFormat:=xlOpenXMLWorkbook
End Sub
I also have 2 ComboBoxes that lists the Month and the Year, so I'd like to have it prefill the Filename with:
"Name of File " & ComboBox_Month & " " & ComboBox_Year
Resulting in: "Name of File April 2023.xlsm"
But, I'm struggling to figure out the correctly way go about it.
Any tips, tricks or advice would be greatly appreciated!