Saving with Today's date as part of the string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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...
 
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
 
It worked Great! Thanks...

KL said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top