ActiveX controls

G

Guest

Hi
Is it possible to designate a cell as a control box and link a macro to it
rather than using one of the ActiveX controls?

Many thanks
 
B

Bob Phillips

If you don't want an ACtiveX control, you could use a checkbox from the
Forms toolbar.

An alternative is this methiod which is invoked by selecting a cell

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "H10" '<=== change to suit

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
End If
.Font.Name = "Marlett"
.Offset(0, 1).Activate
End With
End If
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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