Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print a Single Hidden Worksheet?

I have a dynamic workbook with two hidden sheets named "Lists" and "Day
Cost". The only way I can, at present, print out the "Day Cost" sheet is to
leave it unhidden, however I would prefer to have it hidden as it has
formulas that pull the information from the other visible sheets. Can
somebody help me with a macro that would allow me to have both the "Day Cost"
and "Lists" sheet remain hidden and only print "Day Cost" out.
--
Thanks and Regards,
Don
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Print a Single Hidden Worksheet?

I believe the sheet has to be visible but you can use a sequence like the one
below to print the sheet and it is only visible for an instant.

Sub prtSeq()
Sheets("Day Cost").Visible = True
Sheets("Day Cost").PrintOut
Sheets("Day Cost").Visible = False
End Sub



"SSDSCA" wrote:

I have a dynamic workbook with two hidden sheets named "Lists" and "Day
Cost". The only way I can, at present, print out the "Day Cost" sheet is to
leave it unhidden, however I would prefer to have it hidden as it has
formulas that pull the information from the other visible sheets. Can
somebody help me with a macro that would allow me to have both the "Day Cost"
and "Lists" sheet remain hidden and only print "Day Cost" out.
--
Thanks and Regards,
Don

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Print a Single Hidden Worksheet?

you can give this a try, just change the print parameters

Option Explicit
Sub printHidden()
Dim ws2 As Worksheet
Dim lastrow As Long
Application.ScreenUpdating = False
Set ws2 = Worksheets("Lists")
lastrow = ws2.Cells(Rows.Count, "A").End(xlUp).Row


With ws2.PageSetup
.PrintTitleRows = "$1:$1"
.Orientation = xlPortrait
.PrintGridlines = True
.Zoom = 90
.RightMargin = Application.InchesToPoints(0.4)
.LeftMargin = Application.InchesToPoints(0.4)
.TopMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.5)
.RightFooter = "Page " & "&P" & " of " & "&N"
.RightHeader = "&B&12 " & Date
.PrintArea = "A2:M" & lastrow
.CenterFooter = ""
.FooterMargin = Application.InchesToPoints(0.3)
End With

If ws2.Visible = 0 Then
ws2.Visible = -1
ws2.PrintPreview
ws2.Visible = 0
End If
Application.ScreenUpdating = True
End Sub



--


Gary

"SSDSCA" wrote in message
...
I have a dynamic workbook with two hidden sheets named "Lists" and "Day
Cost". The only way I can, at present, print out the "Day Cost" sheet is to
leave it unhidden, however I would prefer to have it hidden as it has
formulas that pull the information from the other visible sheets. Can
somebody help me with a macro that would allow me to have both the "Day Cost"
and "Lists" sheet remain hidden and only print "Day Cost" out.
--
Thanks and Regards,
Don



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Print a Single Hidden Worksheet?

Hi Don

Try this:

Sub PrintHiddenSheets()
Application.ScreenUpdating = False
With Sheets("Lists")
.Visible = True
.PrintOut
.Visible = False
End With
With Sheets("Day Cost")
.Visible = True
.PrintOut
.Visible = False
End With
Application.ScreenUpdating = True
End Sub

Regards,
Per

"SSDSCA" skrev i meddelelsen
...
I have a dynamic workbook with two hidden sheets named "Lists" and "Day
Cost". The only way I can, at present, print out the "Day Cost" sheet is
to
leave it unhidden, however I would prefer to have it hidden as it has
formulas that pull the information from the other visible sheets. Can
somebody help me with a macro that would allow me to have both the "Day
Cost"
and "Lists" sheet remain hidden and only print "Day Cost" out.
--
Thanks and Regards,
Don


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print a Single Hidden Worksheet?

Thanks guys. you can't imagine how much I have learned from not only your
responses but by all the responses that are posted. You are appreciated.
--
Thanks and Regards,
Don


"SSDSCA" wrote:

I have a dynamic workbook with two hidden sheets named "Lists" and "Day
Cost". The only way I can, at present, print out the "Day Cost" sheet is to
leave it unhidden, however I would prefer to have it hidden as it has
formulas that pull the information from the other visible sheets. Can
somebody help me with a macro that would allow me to have both the "Day Cost"
and "Lists" sheet remain hidden and only print "Day Cost" out.
--
Thanks and Regards,
Don

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing single pages from multiple worksheets in a single print job [email protected] Excel Discussion (Misc queries) 2 April 27th 07 06:11 PM
Can you print separate worksheet on a single page? LisaVH Excel Discussion (Misc queries) 3 November 2nd 06 08:17 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Print correct Page X of Y when printing single worksheet dbarrett44 Excel Discussion (Misc queries) 3 April 14th 06 03:34 AM
Newbie: How to Print by VBA a Single Page in a Worksheet L.A. Lawyer Excel Programming 1 December 22nd 03 10:53 PM


All times are GMT +1. The time now is 06:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"