Hi,
I update a seating chart daily in my office, and I'm looking for help saving the file based off of a cell's value. I'm trying to have the file saved off of cell O28, which contains the date. I can't get the format to save in a yyyy-mm-dd format, though; it saves the file as "vacancy_tally_m/d/yyyy.xlsx" and I want it to save as "vacancy_tally_yyyy-mm-dd.xlsx". Here's what I've got:
Any help? Thanks!
I update a seating chart daily in my office, and I'm looking for help saving the file based off of a cell's value. I'm trying to have the file saved off of cell O28, which contains the date. I can't get the format to save in a yyyy-mm-dd format, though; it saves the file as "vacancy_tally_m/d/yyyy.xlsx" and I want it to save as "vacancy_tally_yyyy-mm-dd.xlsx". Here's what I've got:
Code:
Sub cmd_SaveToC_Drive()
Dim strPath As String
Dim strFolderPath As String
Dim fileSaveName As Variant
strFolderPath = "C:\"
ThisFile = "vacancy_tally_" & Range("O28").Value & ".xlsx"
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=strFolderPath & ThisFile)
If fileSaveName = False Then Exit Sub
ActiveWorkbook.SaveAs Filename:=fileSaveName
End Sub
Any help? Thanks!