+ Reply to Thread
Results 1 to 6 of 6

copy unhidden worksheets to another workbook

  1. #1
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    copy unhidden worksheets to another workbook

    I should find a macro which can function as the following:
    I need to copy all visible worksheet - except worksheet named DATA and macros which are in the original workbook - to a new workbook then use SaveAs to save a specific location.
    Could you offer me a solution based on the attached sample file? Thanks.
    Attached Files Attached Files
    Last edited by ccsmith; 02-03-2015 at 01:35 PM.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: copy unhidden worksheets to another workbook

    I would suggest a macro like this.

    Please Login or Register  to view this content.

    This will "trim" your original file i.e. remove hidden worksheets and the "DATA" sheet and then bring up the file save dialog box so you can save the "trimed" file with a new name and at a new location keeping your original file intact.

    Alf

  3. #3
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: copy unhidden worksheets to another workbook

    Alf: Thanks for your suggestion, it is work almost perfectly but the saved file still contains the macros.
    I would like to avoid to copy the macros to the new workbook. Do you have any solution for this as well?

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: copy unhidden worksheets to another workbook

    A macro like this should fix the problem. Saving a file in the xlsx formate removes all macros as only xlsm files can contain macros.

    The modified macro looks like this:

    Please Login or Register  to view this content.

    Alf

  5. #5
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: copy unhidden worksheets to another workbook

    Alf: Brilliant solution. Many thanks for your reply and support.

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: copy unhidden worksheets to another workbook

    You are welcome.

    Thanks for feedback.

    Alf

+ 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. [SOLVED] List all unhidden worksheets
    By cajand in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2014, 01:04 PM
  2. [SOLVED] Copy Paste only Unhidden columns
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2012, 12:39 PM
  3. Copy only unhidden cells within range
    By Pergo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-03-2011, 11:55 AM
  4. Open hidden workbook on close becomes unhidden
    By Directlinq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2009, 09:45 AM
  5. [SOLVED] copy and paste only unhidden information
    By heatherB in forum Excel General
    Replies: 2
    Last Post: 09-13-2005, 11:05 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