Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i got a checkbox1 on a userform
column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are only 29 days in this month. :) These are valid dates, not just
numbers from 1 to 31 (29) with a month for a header? Mike F "pswanie" wrote in message ... i got a checkbox1 on a userform column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try some code like the following:
Dim R As Range Dim B As Boolean For Each R In Worksheets("Sheet1").Range("D1:D31") '<<< CHANGE AS NEEDED If Int(R.Value) = Int(Now) Then If R(1, 2).Value < vbNullString Then B = True End If Exit For End If Next R If B = True Then CheckBox1.Value = True TextBox1.Enabled = False End If -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... i got a checkbox1 on a userform column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
where would i put this code? i tried it under a commandbutton1_click and
userform initialize (and yip if feb got 28 days then we just ignore the first to days of march etc) "Chip Pearson" wrote: Try some code like the following: Dim R As Range Dim B As Boolean For Each R In Worksheets("Sheet1").Range("D1:D31") '<<< CHANGE AS NEEDED If Int(R.Value) = Int(Now) Then If R(1, 2).Value < vbNullString Then B = True End If Exit For End If Next R If B = True Then CheckBox1.Value = True TextBox1.Enabled = False End If -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... i got a checkbox1 on a userform column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
where would i put this code? i tried it under a commandbutton1_click and
userform initialize The code can go anywhere you want, really. Did it not work when it was attached to CommandButton1? What error(s) did you get? -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... where would i put this code? i tried it under a commandbutton1_click and userform initialize (and yip if feb got 28 days then we just ignore the first to days of march etc) "Chip Pearson" wrote: Try some code like the following: Dim R As Range Dim B As Boolean For Each R In Worksheets("Sheet1").Range("D1:D31") '<<< CHANGE AS NEEDED If Int(R.Value) = Int(Now) Then If R(1, 2).Value < vbNullString Then B = True End If Exit For End If Next R If B = True Then CheckBox1.Value = True TextBox1.Enabled = False End If -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... i got a checkbox1 on a userform column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a feeling that the column just has numbers, not dates
(and yip if feb got 28 days then we just ignore the first to days of march etc) so the line of code: If Int(R.Value) = Int(Now) Then would be comparing 6 to 2/6/2008 for today and not finding a match. pswanie, you should put actual dates in each cell, ie 2/1/2008 for February 1, 2008 (unless you use European dates) and you can drag that cell down to the end of Feb. Mike F "Chip Pearson" wrote in message ... where would i put this code? i tried it under a commandbutton1_click and userform initialize The code can go anywhere you want, really. Did it not work when it was attached to CommandButton1? What error(s) did you get? -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... where would i put this code? i tried it under a commandbutton1_click and userform initialize (and yip if feb got 28 days then we just ignore the first to days of march etc) "Chip Pearson" wrote: Try some code like the following: Dim R As Range Dim B As Boolean For Each R In Worksheets("Sheet1").Range("D1:D31") '<<< CHANGE AS NEEDED If Int(R.Value) = Int(Now) Then If R(1, 2).Value < vbNullString Then B = True End If Exit For End If Next R If B = True Then CheckBox1.Value = True TextBox1.Enabled = False End If -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2008 Pearson Software Consulting, LLC www.cpearson.com (email on web site) "pswanie" wrote in message ... i got a checkbox1 on a userform column n down i got dates for this month 1 thru 31 checkbox1 needs be value = true if data next to todays date are enterd allready. and if checkbox1 value = true then textbox1.enable = false |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checkbox1 linked to sheet1 a1 | Excel Programming | |||
How can I check if any of the entires is True in a range? | Excel Worksheet Functions | |||
Formula: If 2 values (in a range of six) are >3 then TRUE, FALSE | Excel Discussion (Misc queries) | |||
setting range().hidden=True causes range error 1004 | Excel Programming | |||
Checkbox1.LinkedCell = ActiveCell "Why wont this work?& | Excel Programming |