View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Only run if check box is checked

Try

If Sheets("Sheet1").CheckBoxes("Check Box 1").Value = xlOn Then
'do stuff
End If
--
Cheers,
Ryan


"Geoff" wrote:

I have some code that I only want to be run if a check box is checked. So I
inserted an ActiveX check box which I have named cbRecord.

I then put the following IF around the code which is initiated by clicking a
spinner form control:

If cbRecord.Value Then
...
...
...
End If

However, when the code is run I get the following error: Run time error
'424': Object required. When I go to debug, the code doesn't even know that
my check box exists.

TIA...Geoff