+ Reply to Thread
Results 1 to 7 of 7

Save as excel file based on 2 cells

  1. #1
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Save as excel file based on 2 cells

    Hello,

    I would like to create a Macro button that would allow me to save an excel file based on 2 cells:

    E.g:
    Cell A1 = C:\temp\
    Cell A2 = test

    So I would like once clicking on the macro button to have my excel file copied in the path: C:\temp\test.xlsm

    Is it possible? I tried the attached file but got errors.. :-S

    many thanks in advance,,
    G
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Save as excel file based on 2 cells

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Save as excel file based on 2 cells

    Wonderful! I hope it is not too much to ask but is it possible to also save the file in the path: C:\sources

    So let's say I have
    Cell A1 = C:\temp\
    Cell A2 = C:\sources
    Cell A2 = test

    That would be fantastic :P

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Save as excel file based on 2 cells

    What did you mean instead of cell A2 = test - you can't have it being both sources and test...

  5. #5
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Save as excel file based on 2 cells

    To have the excel file saved twice but in to different path:
    so the macro would save as the file in the below path:
    C:\temp\test.xlsm
    AND
    C:\sources\test.xlsm

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Save as excel file based on 2 cells

    I mean for this bit:
    So let's say I have
    Cell A1 = C:\temp\
    Cell A2 = C:\sources
    Cell A2 = test
    cell A2 cannot be two different values at the same time!
    but assuming you have
    So let's say I have
    Cell A1 = C:\temp\
    Cell A2 = C:\sources
    Cell A3 = test

    then:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-21-2007
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    389

    Re: Save as excel file based on 2 cells

    Super It works perfectly! Many thanks :-D

    I only removed "\" in the below line as it gave me an error
    HTML Code: 

+ 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. Save as macro that specifies file type, file location and takes file name from three cells
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-13-2013, 10:09 PM
  2. Replies: 3
    Last Post: 12-16-2012, 03:22 PM
  3. Replies: 0
    Last Post: 12-10-2012, 01:02 PM
  4. Excel Macro to save several text files, based on the contents of two cells.
    By chronologie2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 11:31 AM
  5. I get error messages in Excel cells once I save a file
    By JeffJake in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-28-2005, 07:10 PM

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