Userform Printing

S

sparx

Hello All, can anybody help, I have added a userform to my worksheet via
a macro and have a text box to be displayed onscreen - is there a way to
make this printable as at the moment, pressing ctrl&P or trying to print
while this screen is displayed wont happen?

Any help is much appreciated.
 
B

Bob Phillips

Have you tried

userform1.PrintForm

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
S

sparx

Hi Bob,

No I have not tried that ( still quite new to VB ) and will try it.
Hopefully it will resolve the issue.
Thanks
 
S

sparx

Hi Bob,

Your method did work but can you please help again.

The UserForm1 is called "HelpMe" and consists of a Multipage1 form with
15 header tabs. I put your macro on a command button and it prints out
the first page of the 15 header tabs - how can I make it print all 15
as I dont want to put a button on each page of the Multipage1 form.

One button to print all will be better.

Thanks
 
H

Harald Staff

Private Sub CommandButton1_Click()
Dim i As Long
For i = 0 To MultiPage1.Pages.Count - 1
MultiPage1.Value = i
Me.Repaint
DoEvents
Me.PrintForm
Next
End Sub

HTH. Best wishes Harald
 
S

sparx

Hi Harald, your code worked and many thanks.

Would you know how to within your code, make each page:

enabled = true
print
enabled = false

Whats happening is: the pages I have in the userform are enabled
false ) and each page is greyed out - when you print using your code
the print is also greyed out.

Is there a code that would make each page enabled so the text print
normal then prints, then is not enabled anymore so then looks greye
out again?

I hope you can help
 
B

Bob Phillips

For i = 0 To MultiPage1.Pages.Count - 1
MultiPage1.Pages(i).Enabled = False
MultiPage1.Value = i
Me.Repaint
DoEvents
Me.PrintForm
MultiPage1.Pages(i).Enabled = True
Next


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
S

sparx

Somethings still strange, the text is still being printed greyed out.
Not to worry.

Thank
 
Top