Hide a TextBox

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
 
R

Rick Rothstein

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
Paste TextBox value to worksheet with specific format 1
Stumped 1
Dim statement 8
store variables 4
Excel VBA 1
UserForm Intialization 3
Clear a range of data 4

Top