-
textbox default value
I have 28 textbox that allows user to input their keyword to search. The default value for this is "Enter Keyword".
I want to make it so that when they click inside this textbox, the default goes away so they can enter they're new keyword, but if they exit the textbox without entering anything, the default keyword "Enter Keyword comes back up.
I did the first textbox with an if statement: I was wondering if there's a better way to do this than write 56 different if statement.
Thanks
[VBA]
Private Sub TextBox1_Enter()
If TextBox1.Value = "Enter Keyword" Then
TextBox1.Value = ""
End If
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Value = "" Then
TextBox1.Value = "Enter Keyword"
End If
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules