Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you protect hidden linked worksheets with in an Excel workb | Excel Discussion (Misc queries) | |||
Unhiding All hidden Worksheets with a Macro/VBA Code | Excel Discussion (Misc queries) | |||
Printing Multiple Worksheets | Excel Discussion (Misc queries) | |||
Printing Landscaped and Portrait worksheets at same time...XP | Excel Discussion (Misc queries) | |||
Hyperlinks with hidden worksheets | Excel Discussion (Misc queries) |