BenGreenhill98
New Member
- Joined
- Oct 13, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I'm trying to create a button that, when clicked, saves the whole file to a defined location under a name that is a concatenation of 3 cells. Here's my code so far but i'm clearly doing something wrong
VBA Code:
Private Sub CommandButton1_Click()
Dim strPath As String
Dim strFolderPath As String
strFolderPath = "H:\Desktop\"
strPath = strFolderPath & _
Range("A2").Value & _
Range("E2").Value & _
Range("F2").Value & ".xlsm"
ActiveWorkbook.SaveAs Filename:=strPath
End Sub