Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide a TextBox
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide a TextBox
Try adding this line as the last line of code...
TextBox131.Visible = (TextBox501.Text < "April") -- Rick (MVP - Excel) "Patrick C. Simonds" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide a TextBox
Is this what you wanted or do you want to hide it if it contains the current month? Private Sub UserForm_Initialize() Dim rng Set rng = Cells(ActiveCell.Row, 1) Me.TextBox500.Value = Range("A4").Value Me.TextBox501.Value = rng(1, 1) Me.TextBox501.Text = Format(Me.TextBox501.Text, "MMMM") If Me.TextBox501.Text = "April" Then Me.TextBox501.Visible = False End If End Sub Patrick C. Simonds;309518 Wrote: 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 -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=86545 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide a textbox on open of Excel | Excel Programming | |||
TextBox value to hide a row in another worksheet | Excel Programming | |||
How to hide/show a textbox depending on cell value | Excel Programming | |||
How to hide a textbox | Excel Programming | |||
hide a textbox on a userform? | Excel Programming |