Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The original post has disappeared (for me).
But as an alternative, the OP could use checkboxes from the Forms toolbar. Each of those could be assigned the same macro. I'm not sure how the code varies for each checkbox, but you can determine which checkbox called the macro with code like: Option Explicit Sub testme() Dim myCBX As CheckBox Set myCBX = ActiveSheet.CheckBoxes(Application.Caller) MsgBox myCBX.TopLeftCell.Address '.row or .column will work, too. End Sub Bob wrote: Doug, How do you write the common sub or function? Each check box range increases by one is the only difference. Thank you very much for your help. Bob ----- Doug Broad wrote: ----- Bob, AFAIK, each checkbox must have its own click sub. You can cut and paste the guts from each program or call a common sub or function if each checkbox does substantially the same thing. Regards, Doug "Bob" wrote in message ... How can this code be written for 10 - 20 check boxes in a row that do the same thing? So I do not have to write the code 10 - 20 times for each box? Private Sub CheckBox2_Click() With CheckBox2 If .Value = True Then Worksheets(2).Range("A9:C9").Value = ActiveSheet.Range("A9:C9").Value Else Worksheets(2).Range("A9:C9").Value = "" End If End With End Sub Please help! Thank You -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and move check box (check boxes) with new cell link? | Excel Worksheet Functions | |||
VBA code for the Check Boxes in a form | Excel Discussion (Misc queries) | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
Code for Many check boxes | Excel Programming | |||
code to hide check boxes | Excel Programming |