View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 2pcs of code, a button & a checkbox

Assuming controls from the Control Toolbox Toolbar, use the click event for
the commandbutton
Private Sub Commandbutton1_Click()
if me.Checkbox1.Value = True then
' some code
else
' some other code
end if
End Sub

Post back if from the forms toolbar.

--
Regards,
Tom Ogilvy


"Lynda" wrote in message
...
Hi,

I have two pieces of code, a button and a checkbox.

I would like to be able to have the button operate one
piece of code should the checkbox be checked or another
piece of code if it is left unchecked.

how would i lay it out?

Lynda.