Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print Hidden Sheet (XL97; SR2)

    Is it possible to print a hidden or very hidden sheet. The code I'm using works fine on a sheet that is displayed but not hidden. The code is as follows:

    Sheets("XXX")..PrintOut Copies:=1

    Thanks,
    John

  2. #2
    Star Lounger
    Join Date
    Aug 2001
    Location
    GA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print Hidden Sheet (XL97; SR2)

    how about;
    Sheets("XXX").Visible = True
    Sheets("XXX")..PrintOut Copies:=1
    Sheets("XXX").Visible = False

    If you don't want the to see the screen flash do;
    Application.ScreenUpdating = False
    Sheets("XXX").Visible = True
    Sheets("XXX")..PrintOut Copies:=1
    Sheets("XXX").Visible = False
    application.ScreenUpdating = True
    Don't forget to turn it back on or you'll be sorry.
    Also I like to have the "ScreenUpdating = true" in the 'OnError GoTo' Error handler just incase something goes wrong.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Print Hidden Sheet (XL97; SR2)

    Or, if you want it to check if it is visible, make it so if not, print it and re-hide it if it was before, try this:

    dim shtVisible

    if Sheets("XXX").Visible = False then
    shtVisible = True
    sheets("XXX").visible = true
    end if
    Sheets("XXX")..PrintOut Copies:=1
    if shtVisible = true then Sheets("XXX").Visible = False

    HTH
    Beryl M


Posting Permissions

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