1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Excel 2003 VBA code to Auto Date file names?

Discussion in 'Business Applications' started by LEONARDTRAILERS, Dec 20, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. LEONARDTRAILERS

    LEONARDTRAILERS Thread Starter

    Joined:
    Oct 29, 2010
    Messages:
    32
    Hi again,

    This one should be much easier than my last issue :D...

    I'm writing excel macros and everything is going great except that when i tell my macro to save a particular file i need it to add that day's date (the current date) to the filename...

    Any takers?

    LTT

    Oh yeah, Merry Christmas and Happy Holidays to everyone at Tech Support Guys!!
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    & left(date(),2) & "_" & Mid(Date(),4,2) & "_" & right(date(),4)
    or
    & format(date(), "dd") & "_" & format(date(), "mm") & "_" & format(date(),"yyyy")
     
  3. LEONARDTRAILERS

    LEONARDTRAILERS Thread Starter

    Joined:
    Oct 29, 2010
    Messages:
    32
    I'm in the middle of writing a macro right now, i'll include this in it and let you know how it goes...

    Thank you very much OBP,

    LTT
     
  4. LEONARDTRAILERS

    LEONARDTRAILERS Thread Starter

    Joined:
    Oct 29, 2010
    Messages:
    32
    Sorry, I've had the last few days off... this code worked like a charm! Thank you OBP!
     
  5. Rollin_Again

    Rollin_Again

    Joined:
    Sep 4, 2003
    Messages:
    4,912
    I prefer to use the replace function.

    & Replace(Date, "/", "_")

    Rollin
     
  6. LEONARDTRAILERS

    LEONARDTRAILERS Thread Starter

    Joined:
    Oct 29, 2010
    Messages:
    32
    I'll try the replace function next time, thanks Rollin

    LTT
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/969603

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice