Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default if ... or ... then ?

In vba can you have an if ... then in the format if "x" or "y" then?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default if ... or ... then ?

Max,

You can write your code in a way similar to the following:

If X = something Or Y = something_else Then
' do something
Else
' do something else
End If

If both X and Y are boolean variables (or if they are numeric and you want
to test whether either is not equal to zero), you can simplify the If
statement to

If X Or Y Then


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Max Bialystock" wrote in message
...
In vba can you have an if ... then in the format if "x" or "y" then?




Reply
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 06:52 PM.

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"