Formula for tickbox?!?

  • Thread starter Thread starter Mario London
  • Start date Start date
M

Mario London

:confused:
Is there a formula to add a tick in the tickbox if there is dat
present in another cell? Does this sound confusing
 
Mario,

One way is to use this technique of having a check column, and
monitoring it with a worksheet selection change event. Add your code as
needed.

So if we assume that the data is in A1:A100 (change to suit), clicking in
column A will do what you want with this code.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
End If
.Offset(0, 1).Activate
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub

'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.
 
Set the LinkedCell property of the checkbox to A1 or whatever cell it is to
be linked to.
If the cell value is True the checkbox will be checked, if False it will be
unchecked.
I believe 1 and 0 can be sunstituted for True and False respectively.
HTH
Chris
 

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

Back
Top