Artisez
Member
Need a little help. I need to save a workbook based on 3 cell values for example A2, B2 and C2.
Cell A2 example "05-2024"
Cell B2 example "Planner"
Cell C2 is a timestamp =NOW()
Any help would be appreciated.
>>> use code - tags <<<
Cell A2 example "05-2024"
Cell B2 example "Planner"
Cell C2 is a timestamp =NOW()
Any help would be appreciated.
>>> use code - tags <<<
Code:
Sub SaveWorkbookAsXlsm()
Dim wb As Workbook
Dim folderPath As String
Dim fileName As String
Set wb = ActiveWorkbook
folderPath = "C:\Art\"
fileName = wb.Sheets("Sheet1").Range("A2").Value & "_" & _
wb.Sheets("Sheet1").Range("B2").Value & "_" & _
wb.Sheets("Sheet1").Range("C2").Value & ".xlsm"
wb.SaveAs fileName:=folderPath & fileName, FileFormat:=52
End Sub