Consulting

Results 1 to 2 of 2

Thread: Duplicate entire workbook into 3 copies and leave only specific sheets in the copies

  1. #1
    VBAX Regular
    Joined
    Dec 2016
    Posts
    10
    Location

    Duplicate entire workbook into 3 copies and leave only specific sheets in the copies

    Duplicate entire workbook into 3 copies and leave only specific sheets in the copies

    Hi,

    I'll be happy if you could help me in a quite simple action to write in VBA code. I tried many ways and didn't succeed to complete the needed action (only partially) due to knowledge gaps in VBA...

    I have a Master Workbook containing 5 sheets:
    Sheet #1-> Main
    Sheet #2 -> Subject A
    Sheet #3 -> Subject B
    Sheet #4 -> Subject C
    Sheet #5 -> Help

    I need entire workbook to be duplicated 3 times and after duplication VBA will do the following actions in each copy:

    Copy 1 - Name of workbook need to be: Subject_A >>> Only 'Subject A' sheet remains as is. 'Help' sheet need to be hidden. All other sheets need to be deleted.
    Copy 2 - Name of workbook need to be: Subject_B >>> Only 'Subject B' sheet remains as is. 'Help' sheet need to be hidden. All other sheets need to be deleted.
    Copy 3 - Name of workbook need to be: Subject_C >>> Only 'Subject C' sheet remains as is. 'Help' sheet need to be hidden. All other sheets need to be deleted.

    I need that the duplication will be done into the same folder (!) as of the master workbook, with no need to indicate the path of the folder.

    Macro should run only from Master Workbook.

    Master Workbook need to stay open. All 3 copies need to be close.

    Somehow I can't attach anything to my thread...

    *** Important note: I need the workbook to be entirely copied and then to the delete & hide actions in the copies, and NOT to copy only the requested sheets into the copies (even if action will be longer and less efficient),
    since there are Macro buttons that directing to the master file (not as should be) and conditional formatting that is totally disrupted...

    Thanks in advance

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,875
    No need to answer, cross posted elsewhere.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •