Hello all,

My second post after some excellent help the other day. I have a new workbook that I have created and the final function I need it to do is to save with a filename based on the value of a cell. I have written the below code which correctly opens up the save as window which is great, however the file name field is blank and not the value of cell C32.

Any tips or pointers to help me work this one out? Think it’s just failing to find the right cell value??


Sub Save()

Dim flToSave As Variant
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat
flName = Worksheets("Store & Scheme Details").Range("C32").Value
flToSave = Application.GetSaveAsFilename _
(ThisWorkbook.Path & "\" & flName, filefilter:="Excel Files (*.xlsm), *.xlsm", _
Title:="Save FileAs...")

If flToSave = False Then
Exit Sub
Else

ThisWorkbook.SaveAs FileName:=flToSave, FileFormat:=flFormat
End If

End Sub