I want to be forced into typing in my userform textbox

pwebley

Board Regular
Joined
Mar 2, 2011
Messages
69
I have a custom dialog box (userform) that appears as soon as the workbook is opened. I want the user to HAVE to put a name in the text field and then click submit. If the textfield is blank when they click submit I want the custom dialog box to reappear asking them to do the same thing until something is typed and then they click submit. Any help will be appreciated. I already have the submit button programmed to enter the text into a specific cell.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the forum,

Behind your command button add something like this

If textBox.value="" then
msgbox"Please enter data"
Me.TextBox1.SetFocus
else
'what you want it to do
end if
 
Upvote 0
Thanks for the quick response. I look forward to being on here more often. Now that I have a msg box that prompts me to enter text once I click okay on the msg both boxes disappear I have a userform1.hide command and I want that to stay but I only want it to hide after text has been submitted to the linked cell.
 
Upvote 0
Change the order then

If textBox.value="" then
Me.TextBox1.SetFocus
msgbox"Please enter data"
else
'what you want it to do
end if
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,693
Members
452,938
Latest member
babeneker

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