View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Damon Longworth Damon Longworth is offline
external usenet poster
 
Posts: 111
Default looking for a way to make a form Txtbox only visable on Mondays

Your example references Saturday. If it is to be visible only on Mondays,
have the text box visible property set to False if the day is not Monday:

If Weekday(Now, 2) <1 then ......

If you have multiple days, for example only visible Mon-Fri

If Weekday(Now, 2) <6 then ......


--
Damon Longworth

Don't miss out on the 2005 Excel User Conference
Sept 16th and 17th
Stockyards Hotel - Ft. Worth, Texas
www.ExcelUserConference.com


"andywalker" wrote
in message ...

hi,

I'm looking for a way to make a text box on a form only visible on
certain days of the week. the code i have tried is below. its a bit
naive to be honest so any suggestions would be appreciated:

Private Sub UserForm_Initialize()

If Date = vbSaturday Then
LblIntMon.Caption = "Weight"
TxtBody.Visible = False

TxtBody.Text = LastWeight
Else
LblIntMon.Caption = ""
TxtBody.Visible = False
TxtBody.Text = LastWeight

End If

Thanks in advance


--
andywalker
------------------------------------------------------------------------
andywalker's Profile:
http://www.excelforum.com/member.php...o&userid=24418
View this thread: http://www.excelforum.com/showthread...hreadid=382216