Userform TextBox hiden / visible

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,712
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I have a userform where i have two TextBoxes that may clash.
So i am trying to write something that doesnt show one if the other has a value.

Basically if TB1 is empty then show TB10 but if TB1 has a value then TB10 hiden

I tried this but wasnt hidden when i wrote a value

Rich (BB code):
Private Sub TextBox6_Change()
    If TextBox6.Value = True Then
       TextBox10.Visible = False
    End If
End Sub
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,448
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
Private Sub TextBox6_Exit(ByVal Cancel As MSForms.ReturnBoolean)
   Me.TextBox10.Visible = Me.TextBox6.Value = ""
End Sub
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,448
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,510
Messages
5,548,488
Members
410,840
Latest member
Kar3ousse
Top