+ Reply to Thread
Results 1 to 8 of 8

Copy a value, SaveAs that value (filename), repeat down column until no more values

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Copy a value, SaveAs that value (filename), repeat down column until no more values

    This has been SOLVED. Please see comment below for solution.


    Confusing, I know. Let me explain further. I want to use macros to:
    1. Copy value from Cell A1 from Workbook A
    2. Paste Cell A1 value to Workbook B Cell A1
    3. SaveAs with filename as the Cell A1 value to a separate folder
    4. Repeat steps 1-3 with all values in Column A from Workbook A

    Does this make sense? Is it possible?

    Something like a Mail-Merge in Word, but only in Excel.
    Attached Files Attached Files
    Last edited by huikimhuikim; 03-08-2020 at 01:31 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Put this code in Workbook A

    Change the folder where you want to SaveAs in strPath to suit.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Thank you so much! This is exactly what I wanted!

  4. #4
    Registered User
    Join Date
    05-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Quick question, what would I do if there were multiple columns to Copy/Paste over? Something like this:
    1. Copy value from Cell A1 from Workbook A
    2. Copy value from Cell B1 from Workbook A
    3. Copy value from Cell C1 from Workbook A
    4. Paste Cell A1 value to Workbook B Cell A1
    5. Paste Cell B1 value to Workbook B Cell B1
    6. Paste Cell C1 value to Workbook B Cell C1
    7. SaveAs with filename as the Cell A1 value to a separate folder
    8. Repeat steps 1-7 with all values in Column A from Workbook A

    Does that make sense? Thank you.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Thank you so much for this!

    I have ONE other question. I'm sorry to keep bothering you about this, I was trying to reverse engineer your code, but I'm not experienced enough to change it up

    The only changes are I want to paste the values from Workbook A to Workbook B in different cells, and the SaveAs would be values from Cell B1 from Workbook A.
    1. Copy value from Cell A1 from Workbook A
    2. Copy value from Cell B1 from Workbook A
    3. Copy value from Cell C1 from Workbook A
    4. Copy value from Cell D1 from Workbook A
    5. Paste Cell A1 value to Workbook B Cell C3
    6. Paste Cell B1 value to Workbook B Cell C4
    7. Paste Cell C1 value to Workbook B Cell G2
    8. Paste Cell D1 value to Workbook B Cell G3
    9. SaveAs with filename as the Cell B1 value to a separate folder
    10. Repeat steps 1-9 with all values in Column A-D from Workbook A

    If you need more clarification, please let me know. And, thank you very much for spending time on this!

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Copy a value, SaveAs that value (filename), repeat down column until no more values

    Thank you very much! I appreciate you taking the time to answer all my questions. This is EXACTLY what I was looking for!

    I also noticed the comments that were in there, I knew the "Offset" code had to be in there somewhere, just didn't know how to use it :-)

+ 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: 5
    Last Post: 11-17-2014, 02:40 PM
  2. [SOLVED] SaveAs and Kill filename
    By milo1984 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2014, 02:08 PM
  3. saveas filename=inputbox value?
    By jazbath in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2008, 07:26 PM
  4. Use VBA to change a filename while using SaveAs
    By BigBas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2007, 01:55 AM
  5. VBA- SaveAs filename and add
    By Lucifix in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-21-2007, 06:09 AM
  6. FileName SaveAs
    By alanford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2005, 10:48 AM
  7. 'ActiveWorkbook.SaveAs Filename'
    By TOMB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-15-2005, 08:07 PM

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