Kmahraz
Member
Hi:
I have this code that I found in the link below:
http://stackoverflow.com/questions/21536192/textbox-text-disappear-on-text-entry-excel-vba.
This code does exactly what I need with one exception, I have one section where I need to clear the userform and have it ready for next entry after the Add-button is pressed
So what's happening is that the textbox get cleared VS defaulting into "Please Enter Name Here"
Any suggestions?
Thxs,
K
I have this code that I found in the link below:
http://stackoverflow.com/questions/21536192/textbox-text-disappear-on-text-entry-excel-vba.
This code does exactly what I need with one exception, I have one section where I need to clear the userform and have it ready for next entry after the Add-button is pressed
So what's happening is that the textbox get cleared VS defaulting into "Please Enter Name Here"
Any suggestions?
Code:
Private Sub UserForm_Initialize()
TxtWPN1.ForeColor = &HC0C0C0 '<~~ Grey Color
TxtWPN1.Text = "Please Enter Name Here"
End Sub
Private Sub TxtWPN1_Enter()
With TxtWPN1
If .Text = "Please Enter Name Here" Then
.ForeColor = &H80000008 '<~~ Black Color
.Text = ""
End If
End With
End Sub
Private Sub TxtWPN1_AfterUpdate()
With TxtWPN1
If .Text = "" Then
.ForeColor = &HC0C0C0
.Text = "Please Enter Name Here"
End If
End With
End Sub
K