View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Syntax for "and" and "or"

Sub M()
Dim i, j, k As Integer
i = 1
j = 2
k = 3
If (i = 1 And j = 2) Or k = 3 Then
MsgBox ("true")
End If
End Sub
____________________________
Gary's Student


"knowtrump" wrote:


Can someone please show me the proper syntax for using "and" and "or"
operators with "if" in a Macro? Can they be used together?


--
knowtrump
------------------------------------------------------------------------
knowtrump's Profile: http://www.excelforum.com/member.php...o&userid=19664
View this thread: http://www.excelforum.com/showthread...hreadid=503802