I'm getting a compile/syntax error when i try to run this macro. Can you see what i've done wrong please?
Sub filename_cellvalue()
Dim Path As String
Dim filename As String
filename = Range("B31")
ActiveWorkbook.SaveAs Filename:=filename,
FileFormat:=xlOpenXMLWorkbookMacroEnabled
End Sub
The code is stored in sheet 3 where its run from and sheet 3 B31 contains a string withe the full path i.e.:
C:\Users\john\Documents\joe_bloggs_VN287447_EPL Man Utd vs Chelsea.xlsm
I'm trying to save the workbook with a custom filename based on its contents.
Thanks!
Sub filename_cellvalue()
Dim Path As String
Dim filename As String
filename = Range("B31")
ActiveWorkbook.SaveAs Filename:=filename,
FileFormat:=xlOpenXMLWorkbookMacroEnabled
End Sub
The code is stored in sheet 3 where its run from and sheet 3 B31 contains a string withe the full path i.e.:
C:\Users\john\Documents\joe_bloggs_VN287447_EPL Man Utd vs Chelsea.xlsm
I'm trying to save the workbook with a custom filename based on its contents.
Thanks!