Print all pages in a Multi page userform

A

Alro

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
 
D

Dave Peterson

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
 
B

Bob Umlas

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

Bob Umlas
Excel MVP
 
A

Alro

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

Bob Umlas
Excel MVP

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

 
D

Dave Peterson

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.
 
A

Alro

Dave said:
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.

Dave,

Yes that has worked. Thanks for your help

Allan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top