Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving with Today's date as part of the string
Hello all: I'm trying to save a a workbook with the current day's date
(short) automatically as part of the string. I've tried SaveAs and GetSaveAs with no success. Here is the code: Private Sub btnSave_Click() Dim fName As String MemberDate = xlDateShort ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal fName = "Member Voting -" & MemberDate End Sub Any advice will be sincerely appreciated... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving with Today's date as part of the string
Hi,
Try this: Private Sub btnSave_Click() Dim fName As String fName="Member Voting -" & Format(Date,"yyyy-mm-dd") ActiveWorkbook.SaveAs fName End Sub Regards, KL "The Hawk" wrote in message ... Hello all: I'm trying to save a a workbook with the current day's date (short) automatically as part of the string. I've tried SaveAs and GetSaveAs with no success. Here is the code: Private Sub btnSave_Click() Dim fName As String MemberDate = xlDateShort ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal fName = "Member Voting -" & MemberDate End Sub Any advice will be sincerely appreciated... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving with Today's date as part of the string
You need to assign the value to fdate before you use it in the SaveAs.
hth, Doug "The Hawk" wrote in message ... Hello all: I'm trying to save a a workbook with the current day's date (short) automatically as part of the string. I've tried SaveAs and GetSaveAs with no success. Here is the code: Private Sub btnSave_Click() Dim fName As String MemberDate = xlDateShort ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal fName = "Member Voting -" & MemberDate End Sub Any advice will be sincerely appreciated... |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving with Today's date as part of the string
It worked Great! Thanks...
"KL" wrote: Hi, Try this: Private Sub btnSave_Click() Dim fName As String fName="Member Voting -" & Format(Date,"yyyy-mm-dd") ActiveWorkbook.SaveAs fName End Sub Regards, KL "The Hawk" wrote in message ... Hello all: I'm trying to save a a workbook with the current day's date (short) automatically as part of the string. I've tried SaveAs and GetSaveAs with no success. Here is the code: Private Sub btnSave_Click() Dim fName As String MemberDate = xlDateShort ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlNormal fName = "Member Voting -" & MemberDate End Sub Any advice will be sincerely appreciated... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
Taking out string part which represents date | Excel Worksheet Functions | |||
Automatically saving an Excel spreadsheet with today's date in the filename | Excel Programming |