Hide a TextBox

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

What can I add to the code below to make TextBox131 not visable if the value
(month) in TextBox501 is April?

Private Sub UserForm_Initialize()

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

TextBox500.Value = range("A4").Value
TextBox501.Value = rng(1, 1)
TextBox501.Text = Format(TextBox501.Text, "MMMM")

End Sub
 
Try adding this line as the last line of code...

TextBox131.Visible = (TextBox501.Text <> "April")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Create a public variable 4
TextBoxes and Data Filtering 7
Stumped 1
store variables 4
Paste TextBox value to worksheet with specific format 1
Excel VBA 1
Dim statement 8
Have TextBox display a dollar value 6

Back
Top