+ Reply to Thread
Results 1 to 4 of 4

Replace Part of File Extension Before Running

  1. #1
    Forum Contributor
    Join Date
    04-02-2008
    Location
    Jacksonville Beach, Florida
    MS-Off Ver
    Microsoft Excel 2003 and 2010
    Posts
    264

    Replace Part of File Extension Before Running

    How do I change this code to prompt the user to enter a new date and then change just the date in the file extension before running the rest of the script (the directory folders will always stay the same)?

    Please Login or Register  to view this content.
    ______________________________________
    "Vision without Execution is a Hallucination"
    Edison

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Replace Part of File Extension Before Running

    Remove ChDir
    Avoid Select and Activate in VBA.

    Please Login or Register  to view this content.
    Last edited by snb; 06-28-2010 at 03:22 PM.

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

    Re: Replace Part of File Extension Before Running

    Hello dreicer_Jarr,

    Here is another version of your macro that allows the user to enter the dates as they like, as long as it is a valid date format. Since multiple users will probably be using this, full data validation has been added. The macro will construct the proper file name from the input. Whenever the user enters an invalid date, a message notifies her or him and allows the user to enter the dates again. Here is the expanded macro.
    Please Login or Register  to view this content.
    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!)

  4. #4
    Forum Contributor
    Join Date
    04-02-2008
    Location
    Jacksonville Beach, Florida
    MS-Off Ver
    Microsoft Excel 2003 and 2010
    Posts
    264

    Re: Replace Part of File Extension Before Running

    Both scripts worked perfect. The second seems more mistake proof and so I went with that. Thanks to you both.

+ 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