Hi all.
I would like to use the following code :
Action makes sure the user saves as XLSM file type.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim FileNameVal As String
If SaveAsUI Then
FileNameVal = Application.GetSaveAsFilename(, "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
Cancel = True
If FileNameVal = "False" Then 'User pressed cancel
Exit Sub
End If
Application.EnableEvents = False
ThisWorkbook.SaveAs Filename:=FileNameVal, FileFormat:=52
Application.EnableEvents = True
End If
End Sub
This code is to save a xltm file as xlsm (to keep the macro's in the file)
I would like to have the contents of cell Z88 (= peace of text, generated by values in other cells) as filename.
How can I build the correct uppermentioned code for this ?
And does this cell Z88 need to have the .xlsm in it as well ?
Bookmarks