Hey guys,
I have a spreadsheet here that keeps track of my work through the day. If I want to save the file name with information from a cell, how would I do so?
My code:
So the file should save as "20080805NAME" (name being what is populated in cell E6). If I could put an underscore in there, like, "20080805_NAME" that would be perfect.
Any ideas where I screwed this one up?
I have a spreadsheet here that keeps track of my work through the day. If I want to save the file name with information from a cell, how would I do so?
My code:
Code:
Private Sub CommandButton2_Click()
Dim savename As String
savename = Range("e6") 'This is the cell with the info I need in the file 'name
ActiveWorkbook.SaveAs "C:\workflow\" & Format(Date, "yyyymmdd") & "savename" & ".xls"
End Sub
So the file should save as "20080805NAME" (name being what is populated in cell E6). If I could put an underscore in there, like, "20080805_NAME" that would be perfect.
Any ideas where I screwed this one up?
