LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 793
Default VBA IF THEN with an OR

IF (cond1 OR Cond2) Then
....
Else
....
End If

eg.

Sub test()
If ((Range("a20") = 10)) Or (Range("B20") = 5) Then
MsgBox "Either A20 is 10 or B20 is 5"
Else
MsgBox "both are false"
End If
End Sub
"Papa Jonah" wrote:

I would like to have an IF Then statement that is of the ilk, If this or that
then...
How do I put the "or" part of it in there? I know how to do the or(x,y)
thing in a worksheet.
Thanks,
Papa J

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"