View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pv78 pv78 is offline
external usenet poster
 
Posts: 1
Default checkbox value change


I am writing a simple procedure to uncheck a checkbox if a certain
condition is met but I think it is executing the whole procedure again
on the value change step.

Try pasting this code into excel after creating a checkbox. Not sure
why the msgbox comes up again after I click on no.

Private Sub CheckBox1_Click()
Dim s As Integer

s = MsgBox("Delete numbers?", vbYesNo)
If s = vbYes And CheckBox1 = True Then
'Do stuff
Else
'erase tick in checkbox since nothing was done
CheckBox1 = False 'This is where it brings up the msgbox again
which it shouldn't

End If

End Sub


Thanks for your help!


--
pv78
------------------------------------------------------------------------
pv78's Profile: http://www.excelforum.com/member.php...o&userid=37558
View this thread: http://www.excelforum.com/showthread...hreadid=571889