still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 784
- Office Version
- 365
- Platform
- Windows
Hi
I have a userform that is used to enter a first name or a last name in textboxes
Then, when command button1 is clicked, the macro>>findd<< uses advance filter to find matches for either
If either name is not in the data, a message box comes up
How do I change, or add to, the macro so instead of clicking on the commonbutton, I can just hit enter
ALSO, is it possible to have a message box the can close without hitting OK
mike
I have a userform that is used to enter a first name or a last name in textboxes
Then, when command button1 is clicked, the macro>>findd<< uses advance filter to find matches for either
If either name is not in the data, a message box comes up
How do I change, or add to, the macro so instead of clicking on the commonbutton, I can just hit enter
VBA Code:
Private Sub CommandButton1_Click()
With TextBox5
'last name
ActiveSheet.Range("p2").Value = .Text
End With
With TextBox1
'first name
ActiveSheet.Range("q2").Value = .Text
End With
Me.Hide
findd
Unload Me
If Range("ae2").Value = "" Then
MsgBox (" NO Results")
End If
End Sub
ALSO, is it possible to have a message box the can close without hitting OK
mike