+ Reply to Thread
Results 1 to 3 of 3

Print Preview Hidden Sheets from a UserForm

Hybrid View

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    23

    Angry Print Preview Hidden Sheets from a UserForm

    I'm using userforms as a method to input data and create forms. So far I have Hidden Excel and opened the main Userform on open. I have a total of 5 userforms that all create different forms that I need available for print. On one of the userforms I have a command button to print preview the appropriate worksheets. I need help with the code to show the sheets, execute the preview/print, hide the sheets. All of this without ever displaying the workbook to the user if possible. my current Print preview command is

    Private Sub cmdprintpreview_Click()
        
        'unhide sheets for preview without exposing them
    
        
        'Print Preview for all selected forms
      Me.Hide
        If Me.chk7120 = True And Me.chk71201 = True And Me.chk71203 = True And Me.chk71202 = True Then
            Sheets(Array("7120R", "71201R", "71202R", "71203R")).PrintPreview
        ElseIf Me.chk7120 = True And Me.chk71201 = True And Me.chk71203 = True Then
            Sheets(Array("7120R", "71201R", "71203R")).PrintPreview
        ElseIf Me.chk7120 = True And Me.chk71201 = True And Me.chk71202 = True Then
            Sheets(Array("7120R", "71201R", "71202R")).PrintPreview
        ElseIf Me.chk7120 = True And Me.chk71203 = True Then
            Sheets(Array("7120R", "71203R")).PrintPreview
        ElseIf Me.chk71201 = True And Me.chk71202 = True Then
            Sheets(Array("71201R", "71202R")).PrintPreview
        ElseIf Me.chk7120 = True Then
            Sheets("7120R").PrintPreview
        ElseIf Me.chk71201 = True Then
            Sheets("71201R").PrintPreview
        ElseIf Me.chk71202 = True Then
            Sheets("71202R").PrintPreview
        ElseIf Me.chk71203 = True Then
            Sheets("71203R").PrintPreview
        End If
    
      Me.Show
    End Sub

  2. #2
    Registered User
    Join Date
    08-08-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Print Preview Hidden Sheets from a UserForm

    Problem Solved. Thanks

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Print Preview Hidden Sheets from a UserForm

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. force hidden sheets in preview???
    By thelastvillageidiot in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2011, 06:42 AM
  2. Content gets hidden in Print Preview
    By kumar08 in forum Excel General
    Replies: 1
    Last Post: 07-03-2010, 06:39 PM
  3. UserForm Print Preview
    By jaslake in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-15-2010, 01:08 PM
  4. Replies: 2
    Last Post: 01-24-2007, 05:45 PM
  5. Cells partially hidden in print preview
    By mattslav in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 02:10 PM

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