SlinkRN
Well-known Member
- Joined
- Oct 29, 2002
- Messages
- 715
Hi all,
I'm using this code to save a file using the active workbook's path but then adding a name (which it gets from a cell) and a date (that it gets from the calendar form). My problem is that the date comes out as 11/24 (which won't work as a file name) and I need it to be 11 24 2005. Any suggestions?
Thanks, Slink
Oops, here's the code so far:
I'm using this code to save a file using the active workbook's path but then adding a name (which it gets from a cell) and a date (that it gets from the calendar form). My problem is that the date comes out as 11/24 (which won't work as a file name) and I need it to be 11 24 2005. Any suggestions?
Thanks, Slink
Oops, here's the code so far:
Code:
Option Explicit
Public enddate As Date
Sub SaveAsCode()
Dim path As String
Dim wb As Workbook
Dim name As String
name = Range("g16").Value
Set wb = ActiveWorkbook
path = wb.path
ActiveWorkbook.SaveAs Filename:= _
path & "\" & name & enddate & ".xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub