+ Reply to Thread
Results 1 to 5 of 5

Printing hidden worksheets

  1. #1
    MarcoR
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: 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. #3
    MarcoR
    Guest

    Re: 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. #4
    Dave Peterson
    Guest

    Re: 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. #5
    MarcoR
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1