Hi.
Can anybody please help me to add a function to this code (Or change it all completely to suit) so that when the CommandButton is clicked to save a file, it will do the following:
- Create a new folder, whose name will be determined by the value of cell 'I2', in the destination path folder "Quotes",
- Save the .xlsm file in the new folder with a filename also as determined by the value of cell 'I2'
Ideally, the code should check to see if that new folder name already exists and show a MsgBox as a warning. (In this case, if that folder name already exists, then the user is clicking the wrong button to save the existing file)
My Code as it is:
Private Sub BtnSave_Click()
Dim Path As String
Dim FileName1 As String
Path = "C:\Documents\Kitchens\CLIENTS\QUOTES"
FileName1 = Range("I2")
ActiveWorkbook.SaveAs Filename:=Path & "\" & FileName1 & ".xlsm", FileFormat:=52
End Sub
I await any responses in anticipation.
Thanks in advance
Bookmarks