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 VB code in excell

Take a look at Application.Caller, you can test that to see which checkbox
has been clicked, and do a Select Case on the value

Select Case Application.Caller
Case "Check Box 1": MsgBox "Check Box 1"
Case "Check Box 2": MsgBox "Check Box 2"
Case "Check Box 3": MsgBox "Check Box 3"
End Select

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JCanyoneer" wrote in message
...
I have a spreadsheet with a few check boxes that have macro attached to

them.
When a check box is checked, a macro runs that makes the font in a
corresponding cell, bold. A cell link is also attached to each check box

to
set a value for anothe cell on the page. I have about 20 of these boxes

and
have listed the code I use to bold the font in the cell:

Sub CheckBox88_Click()
Range("B23").Font.Bold = Range("A23").Value
End Sub

What I would like to do, is make one sub routine that I could use for

every
check box rather that having 20 of these little subs. I cannot figure out

the
syntax or how to do this. Does anyone have any ideas?