View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Checkboxes, AND, OR statements

the following pseudo code may give some ideas.

If ckbCoast = True And _
ckbSFR = True Then

Range("A168").Value = "O"

End If

If (ckbCoast = True And _
ckbSFR = True) OR
(ckbCoast = True And _
ckbAdd = True) OR _
(ckbSFR = True And _
ckbAdd = True) Then

Range("A168").Value = "O"
End If

if clng(ckbSFR) + clng(ckbADD) + _
clng(ckbCoast) <= -2 then
Range("A168").Value = "O"
End if





--
Regards,
Tom Ogilvy



" wrote:

This is kind of similar to my last post, but I'm working with AND
statements again in VBA. I'm trying to enter a value into a cell only
if 2 or more different check boxes are marked off. Although this is
very very wrong, something like:

If ckbCoast = True

And

If ckbSFR = True Then

Range("A168").Value = "O"

End If

As another very incorrect example:

If ckbCoast = True

And

If ckbSFR = True

OR

If ckbAdd = True Then

Range("A168").Value = "O"

End If

Thanks for the help guys!