if or statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Hi
one way

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

Cheers
JulieD
 
Bit neater <g>

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top