Excel user form printing with preview!!!

Hi all.

I have created some forms on Excel with all the codes.
Results are displayed on forms.

does anyone has a sample code to structure a customized printing of contents of the userform on A4 paper together with preview?

Need it urgently.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If this is still an issue:

Could you please give some more details?
I'm not quite sure what you mean.

You mode some VBA forms? You want to print those? What needs to be customized?
And you want a preview of this form to be printed?

Kind regards
cappoxy1234Author Commented:

basically, I have some forms with scroll bars. When you use printform, it usually prints only the visible area.
Is there any way to print the whole contents of the form?


Are those scrollbars on the form itselves or are they only scrolling some multiline textboxes?

Kind regards
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

cappoxy1234Author Commented:
They are on the form itself.

I do not have a customised print function, but when it's just printing the form, maybe you could do it quick and dirty by resizing the form for a while.


Sub PrintTheForm()
  Dim dblHeight#
  dblHeight = UserForm1.Height
' replace 323 by the height of your own form
  UserForm1.Height = 323
  UserForm1.Height = dblHeight
End Sub

It's not the most sophisticated solution, but this way you're at least able to print the whole form.
(you needed it urgent).

Kind regards
cappoxy1234Author Commented:
Sorry.. doesn't work.. it only prints one page... how can I print page 2, 3 and so on!!

???? What other pages?
Maybe you should clarify a bit more what you're trying to do?

Kind regards
cappoxy1234Author Commented:
Well... maybe i haven't made myself clear.

a user form can have infinite scroll height (or very huge).
I have tried to change the scroll height to 0 so that it displays the whole contents of the form and then I print the form using printform.
However, the contents of my userform is longer than a standard page on a printer.  When printform is used, it only tried to print the form in one page regardless of whether the contents is going to be longer than a page. in other words, it only prints whatever that can be fit on one standard page and ignore the rest of the contents of the form!!!

I hope I have made mysefl clear.

Ah, OK,

This indeed clears things up.
Well, as far as I can see you have 2 options.

1) use a third party product, for example:

2) Use the WorkAround that Microsoft gives in:

Hope this helps,
Kind regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.