Userform TextBox hiden / visible

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
3,698
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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,023
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,023
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,835
Messages
5,544,588
Members
410,621
Latest member
S Oberlander
Top