userform - user must enter name to begin

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,056
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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

Forum statistics

Threads
1,224,737
Messages
6,180,670
Members
452,993
Latest member
FDARYABEE

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