chungtinhlak
03-26-2009, 07:27 AM
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
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
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
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