Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
MarcoR
 
Posts: n/a
Default Printing hidden worksheets

Hi.

I have a worksheet (Worksheet1)with a command button to print out 4 other
worksheets.
I used Sheets(Array("Sheet2","Sheet3","Sheet4","Sheet5")) .PrintOut
This is working fine.
Now, I want to hide the Sheets2-5 and be able to use the command button to
print them all out.
How is this done?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Printing hidden worksheets

Add code to unhide sheets 2-5, print your worksheets and rehide sheets 2-5.





MarcoR wrote:

Hi.

I have a worksheet (Worksheet1)with a command button to print out 4 other
worksheets.
I used Sheets(Array("Sheet2","Sheet3","Sheet4","Sheet5")) .PrintOut
This is working fine.
Now, I want to hide the Sheets2-5 and be able to use the command button to
print them all out.
How is this done?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
MarcoR
 
Posts: n/a
Default Printing hidden worksheets

Thank you Dave.

As I am a complete beginner, I do not know how to add code to unhide sheets.
Would it be possible for you to give me detailed procedure?



"Dave Peterson" wrote:

Add code to unhide sheets 2-5, print your worksheets and rehide sheets 2-5.





MarcoR wrote:

Hi.

I have a worksheet (Worksheet1)with a command button to print out 4 other
worksheets.
I used Sheets(Array("Sheet2","Sheet3","Sheet4","Sheet5")) .PrintOut
This is working fine.
Now, I want to hide the Sheets2-5 and be able to use the command button to
print them all out.
How is this done?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Printing hidden worksheets

The macro recorder is very useful for stuff like this.

I recorded a macro (and did some minor tweaking (really unnecessary, though) and
got something that looked like:

Option Explicit
Sub Macro1()
Sheets("Sheet8").Visible = xlSheetVisible
Sheets("Sheet7").Visible = xlSheetVisible
Sheets("Sheet6").Visible = xlSheetVisible
Sheets("Sheet5").Visible = xlSheetVisible
Sheets("Sheet4").Visible = xlSheetVisible

Sheets(Array("Sheet8", "Sheet7", "Sheet6", "Sheet5", "Sheet4")) _
.PrintOut preview:=True

Sheets("Sheet8").Visible = xlSheetHidden
Sheets("Sheet7").Visible = xlSheetHidden
Sheets("Sheet6").Visible = xlSheetHidden
Sheets("Sheet5").Visible = xlSheetHidden
Sheets("Sheet4").Visible = xlSheetHidden
End Sub

Remember to use the sheet names you want.

MarcoR wrote:

Thank you Dave.

As I am a complete beginner, I do not know how to add code to unhide sheets.
Would it be possible for you to give me detailed procedure?

"Dave Peterson" wrote:

Add code to unhide sheets 2-5, print your worksheets and rehide sheets 2-5.





MarcoR wrote:

Hi.

I have a worksheet (Worksheet1)with a command button to print out 4 other
worksheets.
I used Sheets(Array("Sheet2","Sheet3","Sheet4","Sheet5")) .PrintOut
This is working fine.
Now, I want to hide the Sheets2-5 and be able to use the command button to
print them all out.
How is this done?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
MarcoR
 
Posts: n/a
Default Printing hidden worksheets

Dave,

It worked.
Thank you so much.

Marco

"Dave Peterson" wrote:

The macro recorder is very useful for stuff like this.

I recorded a macro (and did some minor tweaking (really unnecessary, though) and
got something that looked like:

Option Explicit
Sub Macro1()
Sheets("Sheet8").Visible = xlSheetVisible
Sheets("Sheet7").Visible = xlSheetVisible
Sheets("Sheet6").Visible = xlSheetVisible
Sheets("Sheet5").Visible = xlSheetVisible
Sheets("Sheet4").Visible = xlSheetVisible

Sheets(Array("Sheet8", "Sheet7", "Sheet6", "Sheet5", "Sheet4")) _
.PrintOut preview:=True

Sheets("Sheet8").Visible = xlSheetHidden
Sheets("Sheet7").Visible = xlSheetHidden
Sheets("Sheet6").Visible = xlSheetHidden
Sheets("Sheet5").Visible = xlSheetHidden
Sheets("Sheet4").Visible = xlSheetHidden
End Sub

Remember to use the sheet names you want.

MarcoR wrote:

Thank you Dave.

As I am a complete beginner, I do not know how to add code to unhide sheets.
Would it be possible for you to give me detailed procedure?

"Dave Peterson" wrote:

Add code to unhide sheets 2-5, print your worksheets and rehide sheets 2-5.





MarcoR wrote:

Hi.

I have a worksheet (Worksheet1)with a command button to print out 4 other
worksheets.
I used Sheets(Array("Sheet2","Sheet3","Sheet4","Sheet5")) .PrintOut
This is working fine.
Now, I want to hide the Sheets2-5 and be able to use the command button to
print them all out.
How is this done?

--

Dave Peterson


--

Dave Peterson

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
How do you protect hidden linked worksheets with in an Excel workb Newsgal Excel Discussion (Misc queries) 1 February 21st 06 08:49 PM
Unhiding All hidden Worksheets with a Macro/VBA Code robertguy Excel Discussion (Misc queries) 2 December 2nd 05 03:10 PM
Printing Multiple Worksheets Linda Excel Discussion (Misc queries) 1 August 8th 05 05:12 PM
Printing Landscaped and Portrait worksheets at same time...XP Tamela Excel Discussion (Misc queries) 0 June 7th 05 01:14 AM
Hyperlinks with hidden worksheets MPB Excel Discussion (Misc queries) 4 May 2nd 05 11:48 AM


All times are GMT +1. The time now is 01:20 AM.

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"