creating a simple userform

CameronGates

New Member
Joined
Mar 7, 2019
Messages
18
Remember I'm a newb so if I sound ignorant it's because I am, lol. Ok so I'm creating a simple user form that will be using a bunch of text boxes to input data into specified cells. So the code for each one of the text boxes look like this:

Private Sub TextBox1_Change()
Sheet3.Range("b1") = TextBox1.Value
End Sub

There are something like 60 text boxes all with the same code but specifying different cells and text boxes. here is the stupid question, how do I create the command click ok button to actually make it happen. Lol, sorry guys, i'm really new at this. Thanks for any help you guys can give.
 
Lol, yeah there isn't anything real logical because I realized what I did wrong late in the game as far as creating the text boxes so I'm just going to have to make due with it. Thanks guys for your help! so far everything is working except when I click the ok button the user form does not close so what would I need to do to make it close? I'm guessing I can just use the unload me code because instead of the sheet waiting to be entered until I click ok, It's filling it out in real time. Also What do I need to do to have the already filled out information show up in the userform? Reason being, if I enter the data and then close the form, once I open it back up, the form is empty and if I close out with a blank form it clears all the cells.
 
Last edited:
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If you want to close the Userform but retain the values in the Textboxes.
Put this script in a Button.

Me.Hide

Now if you close the Workbook all the values in the Textboxes will be lost
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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