ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if or statement (https://www.excelbanter.com/excel-programming/314699-if-statement.html)

choice[_2_]

if or statement
 
how would i go about doing:
if range("nightly!cu9").value = "AT&T" or "Verizon" then
application.run "addfeatures"
end if

i dont know how to do the OR part
thanks in advance

daverico[_2_]

if or statement
 

One way is to write:
if range("nightly!cu9").value = "AT&T" then
application.run "addfeatures"
elseif range("nightly!cu9").value = "Verizon" then
application.run "addfeatures"
end i

--
daveric
-----------------------------------------------------------------------
daverico's Profile: http://www.excelforum.com/member.php...fo&userid=1566
View this thread: http://www.excelforum.com/showthread.php?threadid=27232


JulieD

if or statement
 
Hi
one way

if range("nightly!cu9").value = "AT&T" OR range("nightly!cu9").value
="Verizon" then
application.run "addfeatures"
end if

Cheers
JulieD

"choice" wrote in message
...
how would i go about doing:
if range("nightly!cu9").value = "AT&T" or "Verizon" then
application.run "addfeatures"
end if

i dont know how to do the OR part
thanks in advance




Bob Phillips[_6_]

if or statement
 
Bit neater <g

With range("nightly!cu9")
If .value = "AT&T" OR .value ="Verizon" then
application.run "addfeatures"
end if
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi
one way

if range("nightly!cu9").value = "AT&T" OR range("nightly!cu9").value
="Verizon" then
application.run "addfeatures"
end if

Cheers
JulieD

"choice" wrote in message
...
how would i go about doing:
if range("nightly!cu9").value = "AT&T" or "Verizon" then
application.run "addfeatures"
end if

i dont know how to do the OR part
thanks in advance






Dave Peterson[_3_]

if or statement
 
One mo

select case lcase(worksheets("nightly").range("cu9").value)
case is "at&t","verizon": call addfeatures
end select

I like that format for the range.
I checked for Verizon in any case (VeRiZoN, VERIZON, verizon will all be ok)

And if addfeatures is in the same workbook (and it looks like it to me), you can
just call it--you don't need application.run.



choice wrote:

how would i go about doing:
if range("nightly!cu9").value = "AT&T" or "Verizon" then
application.run "addfeatures"
end if

i dont know how to do the OR part
thanks in advance


--

Dave Peterson



All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com