View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default checkbox1 value = true if range got data

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