Then you must pass that as an additional argument
Private Sub Title_Enter()
EntryFormat Title, "Title"
End Sub
Private Sub Title_Exit(ByVal Cancel As MSForms.ReturnBoolean)
ExitFormat Title, "Title"
End Sub
Sub EntryFormat(ctl As MSForms.Control, default as string)
If LCase$(ctl.Text) = LCase$(default) Then
ctl.Text = ""
ctl.BackColor = RGB(255, 255, 153)
End If
End Sub
Sub ExitFormat(ctl As MSForms.Control, default as string)
If Trim(ctl.Text) = "" Then
ctl.Text = default
ctl.BackColor = RGB(255, 255, 255)
End If
End Sub
The enter and exit for each control will be like the first two subroutines above but passing a different control name and default text.
Bookmarks