Userform button question

bpgolferguy

Active Member
Joined
Mar 1, 2009
Messages
469
Hi, I have a question regarding a userform.

I am creating a userform to allow the user to enter certain info, which I will then have transferred to a formatted spreadsheet for neat printing. Here's the thing, I have an area that the user could potentially enter 1 to 10 entries (person's name). I have 10 text boxes currently that the user can enter the name's in to, but in order to keep it neat and user friendly, I want to default and show only one text box upon opening. Then I want to have a button there that they can click for each additional text box to show if needed.

Is that possible? Is there a better way to do what I'm wanting? Thanks everyone!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You could insert a multi-tab control into the userform and have 1 textbox on each sheet to create a wizard-like userface along with labels explaining what the user is supposed to enter. Hope this helps you.
 
Last edited:
Upvote 0
You would have a user form with all boxes there, with hidden = true. On click it will set it to false - thus showing the box
 
Upvote 0
You would have a user form with all boxes there, with hidden = true. On click it will set it to false - thus showing the box

Would I have to have a button for each field/textbox then? I would like one button that adds a field each time it's clicked...one on top of the other. I'm wondering if I'm shooting my hopes too high....
 
Upvote 0
You maybe could be fancy, so on click it advances a variable 1-9 or (2-10). Depending on var value, activate that textbox.
 
Upvote 0
I'm thinking the multipage thing might be a bit confusing......I like the hidden true/false thing, but I think I would need a button there to remove a text box if they click too many times.

Any other ideas? Or a different way I could accomplish what I've stated? I need the ability to add up to 10 fields, but just one at a time as needed.
 
Upvote 0
You set your loop to only handle 9 clicks, then it becomes useless until your form is opened again.
 
Upvote 0
You set your loop to only handle 9 clicks, then it becomes useless until your form is opened again.

How would I do a "remove field" button? I don't know where to start, because how would it know which field to remove? Maybe they needed 7 fields and accidentaly clicked 8.....or needed 2 and clicked for 3?
 
Upvote 0
Personally, I wouldn't worry about removing. Prior to adding to the sheet you can do:
Code:
do while isEmpty(me.textbox___.value)=false
  ' add to ws
loop
___++
This would be in another loop
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,553
Members
452,928
Latest member
101blockchains

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