Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Taking out string part which represents date c8tz Excel Worksheet Functions 8 February 2nd 07 01:08 PM
Automatically saving an Excel spreadsheet with today's date in the filename Ian M Excel Programming 2 April 30th 04 01:09 AM


All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"