+ Reply to Thread
Results 1 to 5 of 5

Macro save with referenced filename and time

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    Houston, USA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Unhappy Macro save with referenced filename and time

    The following macro works but I would like to make it more complex but I get error when I try to reference a cell for a file name.

    How can I get my macro to change from naming "Example file name" to reference a changeable file name typed in cell in my worksheet such as cell B,3 on sheet(1) in a multiple sheet wookbook?

    Also the hh-mm-AMPM always stamps at 12:00AM and not the correct time.

    Please Login or Register  to view this content.
    Last edited by rockhunter; 11-11-2011 at 04:57 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro save with referenced filename and time

    Hello rockhunter,

    The time stamp indicates the cell value is zero. The cell referenced in your macro is D10. What are the current contents of this cell?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-26-2011
    Location
    Houston, USA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Macro save with referenced filename and time

    D10 has a path to the network drive where I want the file to be saved.
    Example X:\reports\test worksheets\

    the macro does save over to the network folder that I want it to with the path in D10.
    However when I try to modify the file name to save as what ever value is referenced to a different cell in the spreadsheet such as D3 it errors on me and just saves as a date stamp and no file name.

  4. #4
    Registered User
    Join Date
    10-26-2011
    Location
    Houston, USA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Macro save with referenced filename and time

    I would like to replace

    Please Login or Register  to view this content.
    with somthing like this with a file name in a cell:
    Please Login or Register  to view this content.
    However this gives me syntax error

  5. #5
    Registered User
    Join Date
    10-26-2011
    Location
    Houston, USA
    MS-Off Ver
    Excel 2007
    Posts
    16

    Talking Re: Macro save with referenced filename and time

    Figured it out...this seems to work. I'll put my revised code in this thread. This macro saves the file to a network path from cell D10 with a file name in cell D3 and places a day time and hour value on the file in this format EX: X:\Documents\reports\test11_11_2011 15_29.xltm.

    Please Login or Register  to view this content.
    Last edited by rockhunter; 11-11-2011 at 05:38 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1