I have created a document which makes use of hundreds of control toolbox tick boxes. Each time one of these is checked, the text values change, i.e. goes bold and black, or normal and grey when unchecked. At the moment, I have to use something like the following for every checkbox...
If Checkbox1.Value = True Then
Checkbox1.Bold = True
Checkbox1.ForeColor = Black
Else
If Checkbox1.Value = False Then
Checkbox1.Bold = False
Checkbox1.ForeColor = Grey
End If
However, due to the number of tick boxes and the number of times this code is repeated, it now takes around 2 minutes to open the document. What I ideally want is just one macro which each tick box calls when checked/unchecked to change it's own values, i.e. something like..
Sub TickBox()
If Me.Value = True Then
Me.Bold = True
Me.ForeColor = Black
Else
Me.Bold = False
Me.ForeColor = Grey
End If
End Sub
However, I can't get this to work as this isn't the correct way to use the MY keyword, any help would be greatly appreciated
Thanks