zakasnak
Active Member
- Joined
- Sep 21, 2005
- Messages
- 307
I have a macro that I run to pull sheets from a workbook into their own file. The file name is created based on value in certain cells. Currently, my code puts today's date at the end of the file name, but I would like for it to pull the date from cell C8. I'm having problems converting my code to make this happen.
I would like for this part: & Format(Date, "yyyymmdd") to pull from C8. I would also like to use the format "yyyymmdd".
Help?
Code:
Sub SaveWS_to_NewWBs()
Dim wb As Workbook
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Copy
Set wb = ActiveWorkbook
wb.SaveAs ThisWorkbook.Path & "\" & ws.Range("A8").Value & " " & ws.Name & " " & ws.Range("X8").Value & " " & Format(Date, "yyyymmdd") & ".xls"
wb.Close False
Next ws
End Sub
I would like for this part: & Format(Date, "yyyymmdd") to pull from C8. I would also like to use the format "yyyymmdd".
Help?