+ Reply to Thread
Results 1 to 2 of 2

Macro to rename current file to include folder name

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    41

    Macro to rename current file to include folder name

    I don't even know if this is possible or not, because I've searched the web for something somewhat close to what I would like to do and came up empty. I have a workbook macro that currently generates a new workbook and opens up to a main folder that list a lot of subfolders that I can choose from to save the file in. The macro automatically names the workbook with the filename I want, which is basically a part number in our system and is created from a cell within the workbook. So when the Saveas dialog box appears, I select a subfolder that uses a Sales Order number for the folder name to put the new file in and then I select Save. I'd like to be able to have that file get renamed after I choose its destination into the correct Sales Order folder to include the name of that folder. I have no idea how to make this happen. I'm guessing it would be additional code that would run right after I save it. Right now, when I save the file where I want it, the code takes me back to my original workbook, which is what I still need to do. Any ideas much appreciated.

  2. #2
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Macro to rename current file to include folder name

    You should be able to edit your current code to do it as you save. Something like this:

    Please Login or Register  to view this content.
    Regards,
    Stephen

    If you feel someone has helped you please thank them and click on the star on their post to add reputation.
    Please ensure that you use code tags where relevant, and mark solved threads as solved.
    Most of all please be respectful and understanding of others.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 01-21-2014, 10:52 AM
  2. [SOLVED] Rename each file in the folder
    By Aquamore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-10-2013, 03:51 PM
  3. [SOLVED] import every file in the folder and rename sheet to the imported file name
    By vivek_work in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-04-2012, 02:46 PM
  4. Rename file and Create new file with new folder with macro/vba
    By rizki96 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2011, 08:01 AM
  5. Macro using file dialog opener - Cannot delete or rename folder when excel macro is
    By startrekremo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2011, 01:57 AM
  6. Struggling with macro to rename file using current date
    By ST4RCUTTER in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2007, 01:13 PM
  7. Replies: 4
    Last Post: 01-11-2006, 08:10 AM
  8. [SOLVED] Macro syntax to open file in current explorer folder
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2006, 08:10 AM

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