+ Reply to Thread
Results 1 to 7 of 7

Print all pages in a Multi page userform

  1. #1
    Alro
    Guest

    Print all pages in a Multi page userform

    I have a multipage userform with 10 pages. Can someone help with the
    code to print all the pages.I tried me.printform but it only prints
    page 1.

    Thanks

    Allan


  2. #2
    Dave Peterson
    Guest

    Re: Print all pages in a Multi page userform

    Maybe something like this:

    Option Explicit
    Private Sub CommandButton1_Click()

    Dim curPage As Long
    Dim iCtr As Long

    curPage = Me.MultiPage1.Value
    For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    Me.MultiPage1.Value = iCtr
    Me.PrintForm
    Next iCtr
    Me.MultiPage1.Value = curPage

    End Sub




    Alro wrote:
    >
    > I have a multipage userform with 10 pages. Can someone help with the
    > code to print all the pages.I tried me.printform but it only prints
    > page 1.
    >
    > Thanks
    >
    > Allan


    --

    Dave Peterson

  3. #3
    Bob Umlas
    Guest

    Re: Print all pages in a Multi page userform

    How about:
    Private Sub CommandButton1_Click()
    For i = 0 To 9
    Me.MultiPage1.Value = i
    Me.PrintForm
    Next
    End Sub

    Bob Umlas
    Excel MVP

    "Alro" <[email protected]> wrote in message
    news:[email protected]...
    >I have a multipage userform with 10 pages. Can someone help with the
    > code to print all the pages.I tried me.printform but it only prints
    > page 1.
    >
    > Thanks
    >
    > Allan
    >




  4. #4
    Alro
    Guest

    Re: Print all pages in a Multi page userform


    Bob Umlas wrote:
    > How about:
    > Private Sub CommandButton1_Click()
    > For i = 0 To 9
    > Me.MultiPage1.Value = i
    > Me.PrintForm
    > Next
    > End Sub
    >
    > Bob Umlas
    > Excel MVP
    >
    > "Alro" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have a multipage userform with 10 pages. Can someone help with the
    > > code to print all the pages.I tried me.printform but it only prints
    > > page 1.
    > >
    > > Thanks
    > >
    > > Allan


    Gents

    Thank you for your quick response. I am getting a compile error on the
    ..multipage1 on both your solutions.

    Private Sub CommandButton172_Click()

    For i = 0 To 9
    Me.MultiPage1.Value = i
    Me.PrintForm
    Next


    End Sub

    Regards

    Allan


    > >



  5. #5
    Dave Peterson
    Guest

    Re: Print all pages in a Multi page userform

    Did you rename the control?

    if you click on the multipage control (in design mode), then click F4, what do
    you see for the (Name) property in the property window.

    Use that.

    Alro wrote:
    >
    > Bob Umlas wrote:
    > > How about:
    > > Private Sub CommandButton1_Click()
    > > For i = 0 To 9
    > > Me.MultiPage1.Value = i
    > > Me.PrintForm
    > > Next
    > > End Sub
    > >
    > > Bob Umlas
    > > Excel MVP
    > >
    > > "Alro" <[email protected]> wrote in message
    > > news:[email protected]...
    > > >I have a multipage userform with 10 pages. Can someone help with the
    > > > code to print all the pages.I tried me.printform but it only prints
    > > > page 1.
    > > >
    > > > Thanks
    > > >
    > > > Allan

    >
    > Gents
    >
    > Thank you for your quick response. I am getting a compile error on the
    > .multipage1 on both your solutions.
    >
    > Private Sub CommandButton172_Click()
    >
    > For i = 0 To 9
    > Me.MultiPage1.Value = i
    > Me.PrintForm
    > Next
    >
    > End Sub
    >
    > Regards
    >
    > Allan
    >
    > > >


    --

    Dave Peterson

  6. #6
    Alro
    Guest

    Re: Print all pages in a Multi page userform


    Dave Peterson wrote:
    > Did you rename the control?
    >
    > if you click on the multipage control (in design mode), then click F4, what do
    > you see for the (Name) property in the property window.
    >
    > Use that.
    >
    > Alro wrote:
    > >
    > > Bob Umlas wrote:
    > > > How about:
    > > > Private Sub CommandButton1_Click()
    > > > For i = 0 To 9
    > > > Me.MultiPage1.Value = i
    > > > Me.PrintForm
    > > > Next
    > > > End Sub
    > > >
    > > > Bob Umlas
    > > > Excel MVP
    > > >
    > > > "Alro" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > >I have a multipage userform with 10 pages. Can someone help with the
    > > > > code to print all the pages.I tried me.printform but it only prints
    > > > > page 1.
    > > > >
    > > > > Thanks
    > > > >
    > > > > Allan

    > >
    > > Gents
    > >
    > > Thank you for your quick response. I am getting a compile error on the
    > > .multipage1 on both your solutions.
    > >
    > > Private Sub CommandButton172_Click()
    > >
    > > For i = 0 To 9
    > > Me.MultiPage1.Value = i
    > > Me.PrintForm
    > > Next
    > >
    > > End Sub
    > >
    > > Regards
    > >
    > > Allan
    > >
    > > > >

    >
    > --
    >
    > Dave Peterson


    Dave,

    Yes that has worked. Thanks for your help

    Allan


  7. #7
    Registered User
    Join Date
    02-24-2020
    Location
    Bonn, Germany
    MS-Off Ver
    10
    Posts
    2

    Re: Print all pages in a Multi page userform

    hi,

    the macro didnt fit the entire page if i send it to pdf printer. Is it possible to enlarge the code to have landscape form and give the pdf print a name.

    thanks jacky

+ 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