Thread: control box
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default control box

I put a checkbox from the Forms toolbar on the worksheet. I assigned that
checkbox the first macro:

Option Explicit
Sub RunTheMacros()
Dim CBX As CheckBox

Set CBX = ActiveSheet.CheckBoxes(Application.Caller)

If CBX.Value = xlOn Then
Call ItsCheckedMacro
Else
Call ItsNotCheckedMacro
End If
End Sub
Sub ItsCheckedMacro()
MsgBox "Checked"
End Sub
Sub ItsNotCheckedMacro()
MsgBox "Not checked"
End Sub

DB74 wrote:

I would like to set up a control box that runs 1 macro when it is checked and
a different macro when I uncheck it...any suggestions?


--

Dave Peterson