ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm, a Multipage and printing... (https://www.excelbanter.com/excel-programming/388207-userform-multipage-printing.html)

IT_roofer

UserForm, a Multipage and printing...
 
I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm, I
have a MultiPage with 9 tabs. They all contain more information than can be
displayed on the UserForm. I would like to be able to have the print button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from a
SPECIFIED page into a sheet and make that print. However, I don't know how to
detect the 'activepage'.

Can anyone help? Thanks in advance!

Norman Jones

UserForm, a Multipage and printing...
 
Hi IY_Roofer,

The MultiPage's Value property returns the page - the
first page is 0


---
Regards,
Norman


"IT_roofer" wrote in message
...
I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know how
to
detect the 'activepage'.

Can anyone help? Thanks in advance!




Peter T

UserForm, a Multipage and printing...
 
I don't know how to detect the 'activepage'.

MultiPage1.Value

Regards,
Peter T

"IT_roofer" wrote in message
...
I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,

I
have a MultiPage with 9 tabs. They all contain more information than can

be
displayed on the UserForm. I would like to be able to have the print

button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from

a
SPECIFIED page into a sheet and make that print. However, I don't know how

to
detect the 'activepage'.

Can anyone help? Thanks in advance!




IT_roofer

UserForm, a Multipage and printing...
 
Norman and Peter... you two solved a good portion of my problem and I thank
you both.

How about being able to set that value and applying it to a print function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '== Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code]) to
get it into a Sheet for printing or is there another method of, like a do or
while statement, that can perform such a proceedure?


"IT_roofer" wrote:

I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm, I
have a MultiPage with 9 tabs. They all contain more information than can be
displayed on the UserForm. I would like to be able to have the print button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from a
SPECIFIED page into a sheet and make that print. However, I don't know how to
detect the 'activepage'.

Can anyone help? Thanks in advance!


Bob Phillips

UserForm, a Multipage and printing...
 
Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"IT_roofer" wrote in message
...
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '== Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code])
to
get it into a Sheet for printing or is there another method of, like a do
or
while statement, that can perform such a proceedure?


"IT_roofer" wrote:

I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!




IT_roofer

UserForm, a Multipage and printing...
 
That's what I mean - how do I dump the data? "If ActivePage = 0 then" and
then write the code to fill cells with captions and values and repeat with
"Elseif ActivePage = 1 then" etc?

"Bob Phillips" wrote:

Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"IT_roofer" wrote in message
...
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '== Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code])
to
get it into a Sheet for printing or is there another method of, like a do
or
while statement, that can perform such a proceedure?


"IT_roofer" wrote:

I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!





Peter T

UserForm, a Multipage and printing...
 
I don't know what data from what (type of) controls you want to dump, it
would be up to you to know which controls you have on any given page. Maybe
this will give you a lead -

For Each ctr In Me.MultiPage1(MultiPage1.Value).Controls
r = r + 1
Cells(r, 1) = ctr.Name
If TypeOf ctr Is MSForms.TextBox Then
Cells(r, 2) = ctr.Text
End If
Next

Regards,
Peter T

"IT_roofer" wrote in message
...
That's what I mean - how do I dump the data? "If ActivePage = 0 then" and
then write the code to fill cells with captions and values and repeat with
"Elseif ActivePage = 1 then" etc?

"Bob Phillips" wrote:

Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my

addy)

"IT_roofer" wrote in message
...
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '== Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the

information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more

code])
to
get it into a Sheet for printing or is there another method of, like a

do
or
while statement, that can perform such a proceedure?


"IT_roofer" wrote:

I know this is possible... I just don't know how to go about it

because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same

UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than

can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from

the
active page. I know how to code the form to dump all the information

from
a
SPECIFIED page into a sheet and make that print. However, I don't

know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!








All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com