Text Box

mriggio

Board Regular
Joined
Jul 28, 2002
Messages
54
Good Monday Morning to all,

I am trying to create a data entry text box where numbers are entered, then placed into a list on a separate sheet. Could someone help me out and give me something to mess around with?

Thanks much.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi, I'm using the following code with one of my projects, perhaps it's useful to you:

Create your UserForm, and design it appropriately. My example is using TextBoxes. Create a "Submit" button on the form. Right-click the Submit button, and choose "view code". You should be presented with the framework looking like this:<span style="font-family:verdana">
Private Sub ButtonName_Click()

End Sub</span>

The code you place inside this Sub will be executed when the user clicks the Submit button. This is where you want to do error-checking (did they enter good values?) and, finally, put the values where you want them.

Here's sample code to take three text boxes, and place the values on a workbook, then close the userform.

Code:
Private Sub Submit_Click()

With Workbooks("Book1").Sheets("Sheet1")
        
            .Range("A1").Value = UserForm.A1TextBox.Value
            .Range("B1").Value = UserForm.B1TextBox.Value
            .Range("C1").Value = UserForm.C1TextBox.Value
End With
    
    Unload UserForm

End Sub

In order to start the whole process, your code must display the form. To do this, use:<span style="font-family:verdana">UserForm.Show</span>

Remember, when you're designing and building your graphical UserForm, it's always helpful to name the elements appropriately. For example, don't leave your Submit button called "Button2", but rather, open the element's Properties, and rename it to SubmitButton.

Good luck.

_________________<form action="http://www.google.com/search" name=f>
google.gif
<input style="border:1px solid;" maxLength=256 size=15 name=q value=""> <input type=submit value="Search" name=btnG></form>
This message was edited by OdinsDream on 2002-08-19 10:50
This message was edited by OdinsDream on 2002-08-19 10:51
 
Upvote 0

Forum statistics

Threads
1,203,356
Messages
6,054,927
Members
444,759
Latest member
TeckTeck

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