

This highlighted code allows you to assign the value at right enclosed in double quotes to the TextBox. Step 6: In the code, insert a line of new code within sub-procedure as below. Step 5: Double click on the submit button or Right click on it and select View Code. You can navigate to properties of command button by Right Click on Command Button > Click Properties. Step 4: Change the caption of the command button to “ Submit” under properties.

Step 3: Insert a CommandButton under UserForm in the same way you added TextBox. Step 2: From UserForm Tools, select TextBox and drag it to UserForm. It is sometimes mandatory to set the values otherwise, the user will input anything of their interest. Let’s see how we can set the values for TextBox. Example #2 – Setting Value to VBA TextBox This is how you can create a VBA TextBox. Step 7: Input the text as “ Welcome to VBA TextBox!” in TextBox under UserForm. Some other basic changes you can do with properties pane of UserForm are like changing the Font, Changing the size, etc. These properties allow you to make some necessary changes like changing the name of UserForm to be able to access it easily.

Step 6: Hit F4 to see the properties of UserForm (Alternatively you can do this by right clicking on UserForm inserted). Step 5: Drag this TextBox on the user form. Step 3: As soon as you insert a UserForm in VBA you can see a Toolbox option associated with it and have different options associated with UserForm. Step 2: As we already have discussed, TextBox is an option available in UserForm.
