Good afternoon,
I have a macro developed that saves a file in a desired location, but if the user presses cancel, the file is saved as "FALSE" in that location. I've tried (and failed) to end the sub on an incorrect name, but it's not working.
Please see below
Sub SaveAs()
Dim FileName As Variant
Range("d4").Select
FileName = ActiveCell.Value
If FileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs FileName = Application.GetSaveAsFilename(FileName, filefilter:="Excel Files(*.xlsm),*.xlsm")
End Sub
Thank you for your time,
I have a macro developed that saves a file in a desired location, but if the user presses cancel, the file is saved as "FALSE" in that location. I've tried (and failed) to end the sub on an incorrect name, but it's not working.
Please see below
Sub SaveAs()
Dim FileName As Variant
Range("d4").Select
FileName = ActiveCell.Value
If FileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs FileName = Application.GetSaveAsFilename(FileName, filefilter:="Excel Files(*.xlsm),*.xlsm")
End Sub
Thank you for your time,