Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide a textbox on open of Excel brittonsm Excel Programming 3 April 10th 09 12:08 AM
TextBox value to hide a row in another worksheet TDC Excel Programming 1 March 19th 07 08:09 AM
How to hide/show a textbox depending on cell value Sam Kuo Excel Programming 3 January 12th 07 07:02 AM
How to hide a textbox filo666 Excel Programming 1 October 11th 05 10:31 PM
hide a textbox on a userform? Bill Lunney Excel Programming 2 July 31st 03 08:57 AM


All times are GMT +1. The time now is 12:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"