selecting checkbox numbers

P

Paula

I have 12 checkboxes in each sheet, one for each month. They are labeled
Checkbox1 thru Checkbox12. Depending on the month, I want the macro to
select the proper checkbox number, for example, for March the checkbox it
should be looking for is Checkbox3. I have variables set for the month,
etc., but can't seem to figure out how to tell it to be a certain checkbox
based on that month in my main macro. I'd prefer to avoid doing a case
statement if I can, but will if that's the only way. Any assistance would
be appreciated.
 
J

Jim Cone

Sub GetThisMonthsCheckbox()
Dim N As Long
N = Month(Date)
Range(ActiveSheet.Shapes("Check Box " & N).ControlFormat.LinkedCell).Value = True
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Paula"
<[email protected]>
wrote in message
I have 12 checkboxes in each sheet, one for each month. They are labeled
Checkbox1 thru Checkbox12. Depending on the month, I want the macro to
select the proper checkbox number, for example, for March the checkbox it
should be looking for is Checkbox3. I have variables set for the month,
etc., but can't seem to figure out how to tell it to be a certain checkbox
based on that month in my main macro. I'd prefer to avoid doing a case
statement if I can, but will if that's the only way. Any assistance would
be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top