View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Simple VBA Code Question (UserForm)

Something Like

Checkbox1.Value = True
Checkbox2.Value = Day(Date) 7
Checkbox3.Value = Day(Date) 14
Checkbox4.Value = Day(Date) 21

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"abxy " wrote in message
...
i'm creating a UserForm in VBA and I've run into a little challenge
which at the moment i just don't have an answer to, so i'm turning here
for help. Here's my problem:

I have a combo box with the months January thru Decemeber as possible
selections, then I have 4 checkboxes for weeks 1 thru 4 of the months,
I would like to somehow make it so that if, the current date isn't
passed a particular date certain checkboxes aren't enabled.

As an example, let's say today is January 2 ...so I select January from
the combo box, but now only the checkbox for Week1 should be enabled
since it's only the first week of January. Now if today was January 8,
then the checkboxes for Week1 and Week2 should be enabled becuase it's
past Week1 of January and it's Week2.

So basically i'm asking for help on the code to say: the value of the
combo box determines the month, and if it's not past a certain day of
that month then this checkbox shouldn't be enabled.

Thanks in advance for any and all help. I really appreciate it.


---
Message posted from http://www.ExcelForum.com/