Add default value to userform text box

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,247
Office Version
  1. 2016
Hi,

I need to add a default value to a field in a userform.

For example, when a userform is opened and also when i click a submit button to enter the data, the clear form will show a default value in one particular field.

Basically I want one field named field1 to always have a default numerical value inserted. This can be cleared by the user but initially it should always show in the field.

Is this possible?

Thank you.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Kenneth Hobson

Well-known Member
Joined
Feb 6, 2007
Messages
3,181
Office Version
  1. 365
Platform
  1. Windows
In the Properties window for that control, set the Value property. Press F4 to view that window or in VBE, select that option in the View menu. If you want a dynamic value, then set Textbox1.value = "whatever" in the Userform's Initialize event.
 
Upvote 0

nparsons75

Well-known Member
Joined
Sep 23, 2013
Messages
1,247
Office Version
  1. 2016
Hi Kenneth,

How do you mean dynamic. I simply want the field to always show the value '20'

I need the value to appear in the box each time the userfom opens and each time data is submitted and the form is ready to add new data.

Thanks for the help.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,195,848
Messages
6,011,949
Members
441,657
Latest member
Diupsy

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
Top