Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Wichita, Kansas, USA
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing a Hidden Sheet using VBA (2000)

    I need to print a "hidden" worksheet from a button on a different worksheet, with VBA code behind the button. I can't seem to get the VBA syntax correct.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing a Hidden Sheet using VBA (2000)

    You must unhide a hidden sheet before you can print it. To avoid the user seeing what is being done, set ScreenUpdating to False during the macro. Something like this:

    Sub cmdPrint_Click()
    On Error GoTo ErrHandler

    Application.ScreenUpdating = False
    With Worksheets("HiddenSheet")
    .Visible = True
    .PrintOut
    .Visible = False
    End With

    ExitHandler:
    Application.ScreenUpdating = True
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  3. #3
    Star Lounger
    Join Date
    Aug 2002
    Location
    Wichita, Kansas, USA
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a Hidden Sheet using VBA (2000)

    Thank you so much Hans! The "Screen Updating" worked for me - don't think I would have found it on my own.

    Patty

Posting Permissions

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