Multipage Userform

begoldar

Board Regular
Joined
Dec 20, 2005
Messages
98
Hi Everyone,

I have a multipage userform that activates pages based upon an option button the user selects. ie: select option 1, takes user to page 2, select option 2, takes user to page 3.... In these pages there are text boxes which the user has to fill out. Unfortunately, two pages are exactly the same (user needs to fill out same data.) So, rather than make my code really ugly by having every box with a unique name, I was hoping there's a way to clean things up. So:

Is it possible to have the 2 of the inital option buttons take the user to the same page?

Or

Rather than take the user the same page, is it possible to have the two pages use the same text boxes? (That way, I only have to name them once)

Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I've used something like this in the past with seperate Billing & Shipping information pages:

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> CommandButton6_Click()
    <SPAN style="color:#007F00">' Copy Address Fields</SPAN>
    <SPAN style="color:#00007F">For</SPAN> i = 40 <SPAN style="color:#00007F">To</SPAN> 51
        Me.Controls("tb" & i).Value = Me.Controls("tb" & i - 18).Value
    <SPAN style="color:#00007F">Next</SPAN> i
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Using a button to populate shipping data with the billing data.

Hope that helps,

Smitty
 
Upvote 0
The code is looping from Text Box (tb) 40 to 51.

The controls in that form are numbered sequentially, so in this case on MP1 they're numbered 16-33 and on MP2 they're numbered 34-51. I'm capturing information from tb's 22-33 and putting it in corresponding tb's 40-51.

I'd be happy to send you a copy of it.

Smitty
 
Upvote 0
Oh ok. Unfortunately each of my textboxes has a unique name (so that I can recognize it in the code). Is there a way to modify your code so that it would recognize these names? Or do I have to write a line of code for each text box? Thanks again for the help!
 
Upvote 0
That's one of the problems with naming them like that.

Offhand (meaning it's Friday and I'm brain dead), I can't think of a way to do it without specifically referring to them if that's the naming convention you used.

Smitty
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top