Reputation: 19
I have created a VBA code which creates a folder, named after a referenced cell, then within that folder I have created multiple sub folders. What I now want is a new code to save the excel sheet within one of the sub folders with a specific name, this is what I have so far. I think I am writing the path wrong or maybe using the wrong syntax. Please help ;)
I have included a copy of the code and an image hopefully it uploads correctly.
Private Sub CommandButton1_Click()
' automates the saving
Dim path As String
Dim filename1 As String
path = "T:\Estimating\Williaam Cox Project Enquiries 2018\" & Range("SaveRef") & "\Costings"
filename1 = Range("SaveRef").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=path & "Costing Sheets" & ".xlsm", FileFormat:=52
Application.DisplayAlerts = True
End Sub
Upvotes: 1
Views: 1181