create a check box, say Check box 1
use
Code:
for each a in activesheet.shapes:? a.name:next
in immediate to see the name
to my knowledge checkbox must be linked to a cell. So write click on it and link it to a cell, say cell(1,1) (or "A1")
paste the following code in the Worksheet and experiment with the "valid" areas that initially are set to A1:D3. Changes occur for values bigger or smaller than 10...later you can adjust this at will.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim UPRw As Long, DWNRw As Long, LftClmn As Long, RgtClmn As Long, CurRw As Long, CurClmn As Long
Dim dum1
CurRw = Target.Row: CurClmn = Target.Column
UPRw = 1: DWNRw = 3 'Valid Rows
LftClmn = 1: RgtClmn = 4 'Valid Columns
If (CurRw >= UPRw And CurRw <= DWNRw) And (CurClmn <= RgtClmn And CurClmn >= LftClmn) Then
'we are within valid range
If Target.Value > 10 Then Cells(1,1) = False Else Cells(1,1) = True
Set dum1 = Selection
ActiveSheet.Shapes("Check Box 1").Select
Selection.Characters.Text = "Check Box " + Format(Target.Value, "00")
dum1.Select
End If
End Sub
Valid Area can be omitted but it is useful to restrict running the code in areas of your interest. Fit to your needs, use ranges and
Code:
set newRange=application.intersect(range1,range2...)
if not newrange is nothing then
...
end if
if needed