[mso] Excel VBA Add Date to File Name - I give up

  • From: "McDonald, Christine, Ms, DCAA" <Christine.McDonald@xxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Fri, 6 Aug 2004 18:07:23 -0500

Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: 7bit
Okay, I give up.  I have some VBA code that saves each worksheet to a file
using the sheet name.  I would like to change it so the name of the new
file is the sheet name plus the current date.  I have tried everything I
can think of to get this to work, with no success.  
Here's the part of the code that saves the workbook using the sheet name:

For Each wks In Worksheets
    wks.Select
    wks.Copy
    stSName = ActiveSheet.Name
    Application.DisplayAlerts = False

stFullName = stPath & "\" & stSName
    ActiveWorkbook.SaveAs Filename:=stFullName

Can someone help me get it to add the current date to the file name.

Thanks,

Christine McDonald
Technical Specialist
Western Regional Office
Information Technology Division (RSA-4)




-- Binary/unsupported file stripped by Ecartis --
-- Type: application/x-pkcs7-signature
-- File: smime.p7s


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: