+ Reply to Thread
Results 1 to 7 of 7

Code to save current worksheet and hidden worksheet

  1. #1
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Code to save current worksheet and hidden worksheet

    Hi...I have this code (thanks Dom) to save the current worksheet but in the main workbook there is also a hidden worksheet which I need to save with the current worksheet workbook. This hidden worksheet must remain hidden in the new workbook as it has some calculations the user does not need to see.
    The current code is

    Please Login or Register  to view this content.
    Can anyone please help with amending the code to save the hidden worksheet with the current worksheet? The hidden worksheet is called "calcs".

    Thanks
    Last edited by fusion007; 06-27-2011 at 04:45 AM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Code to save current worksheet and hidden worksheet

    fusion007,

    Change this line:
    Please Login or Register  to view this content.


    To this instead:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Code to save current worksheet and hidden worksheet

    Hi tigeravatar...thanks for the reply
    I changed the code but that still doesn't copy the hidden worksheet to the new workbook.
    Any other suggestions I can try?

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Code to save current worksheet and hidden worksheet

    fusion007,

    Is the worksheet not named "calcs"? The macro simply deletes all other sheets then saves the remaining as a workbook under a different name. Also, the macro would not unhide the hidden worksheet.

    ~tigeravatar

  5. #5
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Code to save current worksheet and hidden worksheet

    Hi...yes the hidden worksheet is "calcs". On the saved workbook I checked if the hidden sheet was there but there wasn't.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Code to save current worksheet and hidden worksheet

    fusion007,

    Revamped the macro a bit, give this a try:
    Please Login or Register  to view this content.


    If you're still having problems, please upload the workbook with fake data so I can see what's going on

    Hope that helps,
    ~tigeravatar
    Last edited by tigeravatar; 06-22-2011 at 12:24 PM. Reason: typo

  7. #7
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Code to save current worksheet and hidden worksheet

    Hi...that has worked fine thanks. But I have another problem now - not to do with your code though. The hidden worksheet has calculations and macros which is used to load data into a system and and is now not working.
    so rather than saving the workbook is there a way that the macro I am using to copy the data is pasted into another workbook that is already saved rather than in the current workbook and then saving this worksheet as a different workbook.
    I hope this makes sense.
    Apologies if I should open a new thread for this.
    Thanks

+ 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