+ Reply to Thread
Results 1 to 7 of 7

Copying tabs to new workbook with Macro

  1. #1
    Registered User
    Join Date
    03-24-2017
    Location
    US
    MS-Off Ver
    office 2016
    Posts
    3

    Copying tabs to new workbook with Macro

    Hi,

    I have a spreadsheet with a data tab and 12 tabs for each month of the year. This spreadsheet is financial statements for each month. I created a Macro on the Dec tab to copy all the tabs and move it to a new work book for the next years financial statements and to pull forward the cumulative totals into the January statement on the new workbook.

    My issue is when the new workbook is created and we reach the end of the year again the Macro button on the newly created workbook doesn't work again because it doesn't pull the Macro from the previous workbook, just the button. Is there a way I can get the original macro to pull thru on continuous workbooks for reports with multiple years?
    Last edited by dramond1975; 03-24-2017 at 04:04 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Copying tabs to new workbook with Macro

    I assume you mean one of the modules didn't copy (because the code attached to the sheet being copied will move across, but the module doesn't belong to the sheet - it belongs to the workbook - so isn't copied).

    Easiest way would be to create a copy of the entire workbook (to get the VBA modules, UserForms etc), add a dummy sheet (because you can't have no sheets in a workbook), delete all sheets but the dummy sheet, copy the source sheets into the workbook, then delete the dummy sheet.

    Make sense?
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Registered User
    Join Date
    03-24-2017
    Location
    US
    MS-Off Ver
    office 2016
    Posts
    3

    Re: Copying tabs to new workbook with Macro

    Yes it does. I will try that.

    Thanks

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Copying tabs to new workbook with Macro

    Hi draymond

    Perhaps another way is to use a Master workbook as your Financial Statement.
    Create a macro within that does the following:
    1. At year end, Save a copy to a folder as a pdf.
    2. Copy Dec Closing balances to Jan
    3. Clear Rest

    Your new Mater is then ready for next year
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Copying tabs to new workbook with Macro

    @ sintek,

    Great idea, but you could use .csv as well, and not only pdf.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Copying tabs to new workbook with Macro

    Ja Nee Winon....Reg so

  7. #7
    Registered User
    Join Date
    03-24-2017
    Location
    US
    MS-Off Ver
    office 2016
    Posts
    3

    Re: Copying tabs to new workbook with Macro

    Thanks for all the responses. I just got in to work and will try them. I appreciate the help.

+ 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. Creating new workbook using a template and copying tabs
    By JohnDoh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-27-2015, 03:17 AM
  2. Getting list of tabs of a workbook macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2013, 05:38 AM
  3. [SOLVED] Extract data from a workbook with multiple tabs, into a workbook with corresponding tabs
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 11:54 AM
  4. Copying values from multiple Tabs of a WB into corresponding Tabs of another WB using VBA
    By sanc.jobs2012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2012, 06:15 AM
  5. Problem copying multiple tabs to a new workbook
    By bleat in forum Excel General
    Replies: 1
    Last Post: 05-23-2012, 06:09 AM
  6. copying and pasting tabs macro
    By floricita in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-02-2010, 06:02 AM
  7. Macro for naming tabs and copying text files into Excel
    By lucaserino in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2009, 08:32 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