+ Reply to Thread
Results 1 to 2 of 2

Save As macro with only partial file path

  1. #1
    Registered User
    Join Date
    10-24-2013
    Location
    Logan, Utah
    MS-Off Ver
    Excel 2010
    Posts
    1

    Exclamation Save As macro with only partial file path

    I am trying to create a macro for a "save as" button that will determine the file name based on a cell value (E4) and the location to save it based on another cell value (G4). However cell (G4) only contains the first 6 characters of the sub folder name. I can't change the names of the folders but the first 6 characters are always unique and known while the rest of the folder name is unknown. Having to search for and input the entire folder name would require more work than just a regular file/save as/browse/…

    Example (1): E4=”filename” & G4=”654321” and I need the file "filename.xlsm" to be saved in a folder "W:\0 3 BIN SYSTEM\654321 some unknown stuff here\"

    Example (2): E4=”otherfilename” & G4=”123456” and I need the file "otherfilename.xlsm" to be saved in a folder "W:\0 3 BIN SYSTEM\123456 different unknown stuff here\"

    Here is what I currently have. It works just fine if I have the entire folder name in G4:

    [I]
    Please Login or Register  to view this content.
    Last edited by jake.newport; 10-27-2013 at 11:38 AM. Reason: added code tags

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: Save As macro with only partial file path

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them this time. Please read our rules and abide by them in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. how to specify a file save path to a save macro
    By Solidstan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-04-2013, 05:33 PM
  2. [SOLVED] VBA for file save as macro enabled to a specifi path and folders
    By stpeter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2013, 03:41 PM
  3. [SOLVED] Opening file with file path and partial name
    By bocaj315 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-13-2013, 01:53 PM
  4. Macro to save sheet as CSV using a dynamic file name and file path
    By chris.tinta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 10:45 AM
  5. Find File with partial filename and get path of folder
    By axisambrosia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2012, 06:51 AM

Tags for this Thread

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