+ Reply to Thread
Results 1 to 5 of 5

copy active sheet, create new workbook, name new workbook based on cell reference

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    copy active sheet, create new workbook, name new workbook based on cell reference

    I am trying to create a macro that will copy the active sheet and paste values, not formulas, to a new workbook (would need to create the workbook), name the workbook based on cell A4 in the worksheet and close. It would then go back to the original active sheet, select the next value in the data validation drop down list in cell A4 and repeat the entire procedure until it reaches the end of the data validation list. I've attached the worksheet here for a visual. Any help would be appreciated.
    Last edited by jm0392; 08-20-2012 at 07:08 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: copy active sheet, create new workbook, name new workbook based on cell reference

    Hello there,

    The below code should work for you:

    PLEASE NOTE: I have highlighted the line of code that you will need to change to your Save as filepath red in the below code. If you do not know the file path, open a workbook in the folder/location and in an empty cell type =CELL("filepath") this will give you the location.

    Please Login or Register  to view this content.
    To insert this code

    1. Press Alt+F8 on your keyboard
    2. Clear the macro name field
    3. Type the following in the macro name field SaveIBPQtrlyUpdate
    4. Select the Create option
    5. In between the Sub SaveIBPQtrlyUpdate() and End Sub copy and paste the above code, anything that appears in green is a comment meant to help you understand
    6. Change the file path as instructed above
    7. Close out of VBA and then press Alt+F8 again
    8. Select the SaveIBPQtrlyUpdate macro and select Run.

    Let me know if this works for you!

    Thanks!
    Last edited by rvasquez; 08-20-2012 at 04:56 PM. Reason: added comments

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: copy active sheet, create new workbook, name new workbook based on cell reference

    This works like a charm! Thank you so much!
    Last edited by jm0392; 08-20-2012 at 07:09 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: copy active sheet, create new workbook, name new workbook based on cell reference

    If the hyperlinks are in the cells as a result of hard hyperlinks (CTRL-K to open the hyperlink window on a cell), those links should be retained when the "paste values" occurs. But if the cells have HYPERLINK() formulas in them, then those links would not survive the removal of the formulas themselves.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    08-20-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: copy active sheet, create new workbook, name new workbook based on cell reference

    Thanks - figured that out and have adjusted the links - appreciate all the help!

+ 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