View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Macro to print a hidden sheet

try this...

Sub PrintSpecificSheet()
Dim wks As Worksheet

Set wks = ActiveWorkbook.Sheets("Sheet2")
If wks.Visible < xlSheetVisible Then
Application.ScreenUpdating = False
wks.Visible = xlSheetVisible
wks.PrintOut
wks.Visible = xlSheetHidden
Application.ScreenUpdating = True
Else
wks.PrintOut
End If
Set wks = Nothing
End Sub

The only side effect to the code is that if the sheet was previously set as
xlVeryHidden (which can only be set in code so it probably does not apply)
then after the procedure is run it will only be xlHidden. There is a 99.9%
chance that you really don't need to wory about this.

HTH

"Glenn" wrote:

I was give the following to make a button to print a sheet. But how do i
make this macro to print a hidden sheet?
I really do appreciate everyone's help
GlennHi Glenn
---------------------------------------------------------------------------
Identify the specific sheet you want to print in the code.....

Sub PrintSpecificSheet()
ActiveWorkbook.Sheets("Sheet2").PrintOut
End Sub
--

-----
XL2003
Regards

William




"Glenn" wrote in message
...
I am a novice learning....
I would like to know how I can write a macro that would make a particular
worksheet print. I would like to press a button on one sheet and make
another sheet print.
Thanks for your help,
Glenn