userform - user must enter name to begin

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,004
Office Version
  1. 365
Platform
  1. Windows
Hi, how do i set up a userform to make users enter their name before they can proceed? I don't want to use an inputbox before the form is called as the form is meant to help them save time while answering telephone calls. Currently, their is just a text box for them to input their name but most don't. this makes tracking who made what changes difficult.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
If you have a button in the userform to save the data on the sheet, there you can put the following:

Code:
Private Sub CommandButton1_Click()
  If TextBox20 = "" Then
    MsgBox "Enter your name", vbCritical, "SAVE DATA CANCELED"
    TextBox20.SetFocus
    Exit Sub
  End If
  '
  'Continue your code to save the data on the sheet.
  '
End Sub
 
Upvote 0
If you have a button in the userform to save the data on the sheet, there you can put the following:

Code:
Private Sub CommandButton1_Click()
  If TextBox20 = "" Then
    MsgBox "Enter your name", vbCritical, "SAVE DATA CANCELED"
    TextBox20.SetFocus
    Exit Sub
  End If
  '
  'Continue your code to save the data on the sheet.
  '
End Sub

cheers Dante. that should do the trick nicely. I have a button to add the data to the report so will put your snippet in. Fantastic.
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
  • Like
Reactions: ajm
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,306
Members
448,564
Latest member
ED38

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