[RESOLVED] Grrr... Saving Excel File As Cell Value
Hey Guys,
I currently creating a pay period spreadsheet through excel with a calendar that pops up after clicking the pay period cell to show the pay period which you select. example: Click May 1st 2013 on the calendar and cell R2 displays date 5/1/13. I then tried creating a button to save the excel file as the date specified in cell R2 but no luck it wouldn't work. So I finally thought that maybe its because you cant save "/" as your file so on Sheet 2 I created a cell that would display Sheet1's R2 cell as May 1st, 2013. Tried saving again and it wouldn't save. Another error appeared. Am I doing something wrong or is it just not possible to do this action? Please help me, been puzzling me for over a week.
Code:
Sub SaveMe()
Dim strName As String
strName = Sheet2.Range("F1").Value
ActiveWorkbook.SaveAs strName
Exit Sub
End Sub
Office Version: 2007
Re: Grrr... Saving Excel File As Cell Value
Quote:
Sheet1's R2 cell as May 1st, 2013
probably the comma, best to format the date as you go, like
Code:
strName = format(Sheet2.Range("F1").Value, "yyyymmdd")
Re: Grrr... Saving Excel File As Cell Value
You sir are a genious haha such a simple fix, I've tried the formatting thing also just set it up wrong apparently. You rock THANKS! :)