list - Excel - VBA : Simplify this If statement comparing cell to words -
easy question here.
using in program :
if lcase(inp_rng.offset(1, 0).value) = "street" or lcase(inp_rng.offset(1, 0)) = "ave." score = score - 50 end if
it not clean can find way put in 1 sentence only. programming way of writing this:
if lcase(inp_rng.offset(1,0).value = ("street", "ave.", "road", "...", etc.) 'do end if
thanks in advance!
you can use select case statement instead:
i = lcase(inp_rng.offset(1,0).value select case case "street", "ave.", "road" 'do case else 'do end select
alternatively can populate possible answers in array , search array match.
Comments
Post a Comment