+ Reply to Thread
Results 1 to 9 of 9

Macro to print from a VERY hidden worksheet

  1. #1
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Macro to print from a VERY hidden worksheet

    Happy Saturday All,

    I have a workbook I built with only 2 sheets visible and several VERY hidden. On one of the very hidden sheets named “training” I have not only formulas and numbers but I also have a summary area that my print area is set to only print out. What I was hoping I could have done was placed a “print” button on one of the non-hidden sheets and when it is pressed it would also print the area on just the very hidden training tab. Is that possible? I saw a few macro’s to print a hidden sheet but it didn’t work for me and I am assuming that is because mine is set for very hidden?
    Can this be done? If it can I saw on the other type a way to not show the screen updating so that no one would see it is unhidding, printing and then re-very hiding the sheet

    Is this something anyone can please help me with?

    Thx in Advance,

    Dave

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to print from a VERY hidden worksheet

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Macro to print from a VERY hidden worksheet

    Thx, I'll give it a try...

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to print from a VERY hidden worksheet

    You're welcome.

  5. #5
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Macro to print from a VERY hidden worksheet

    SHG, I hope you are still monitoring this thread, I do have a follow up question. Your code worked perfectly but while reading some other threads it mentioned how to not have the screen flash to my hidden page while it was running. It said to do so to add at the beginning this line of code Application.ScreenUpdating = False
    I've tried adding it at every point can't seem to get it to work, do you know where it should go? What the description on the page I read said was:

    Of course, unhiding and later hiding worksheets can cause a lot of flashing on the screen as Excel tries to update its screen display based on the commands executed in your macro. If you want to avoid this, then use the following line of code at the beginning of your macro:

    Application.ScreenUpdating = False
    With screen updating turned off in this way, nobody will ever know that you unhid a worksheet and later rehid it. Make sure that before ending the macro, however, you set the ScreenUpdating property back to True.

    This add in would be great but if not yours works perfect. I was just hoping u could help me figure out where to insert it.

    Thx,

    Dave

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Macro to print from a VERY hidden worksheet

    normally
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Macro to print from a VERY hidden worksheet

    Hi Guru, it gives me an error that says:

    Run-Time '9':

    Subscript out of range

    any tjoughts?

  8. #8
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Macro to print from a VERY hidden worksheet

    sorry, i got it. I forgot to change the name back to the hidden sheet name. Thank you for the help

  9. #9
    Registered User
    Join Date
    03-25-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2016
    Posts
    98

    Re: Macro to print from a VERY hidden worksheet

    Is it possible to password protect this macro from running? and if I wasnt to print more than 1 sheet would it just be ,sheet2name,sheet3name?

+ 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. Print macro erroring if there are hidden sheets
    By davidjoe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2012, 03:51 PM
  2. Macro to print on sheets which are not hidden
    By BRISBANEBOB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2008, 04:40 AM
  3. Macro - Print Fit to page even with Hidden Columns ?
    By Airman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2008, 07:32 AM
  4. Visual Basic Macro to print hidden worksheet
    By Noel S Pamfree in forum Excel General
    Replies: 4
    Last Post: 10-12-2005, 09:05 PM
  5. Macro to print a hidden sheet
    By Glenn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-18-2005, 07:06 PM

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