View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Wild Bill[_2_] Wild Bill[_2_] is offline
external usenet poster
 
Posts: 90
Default Checking the last character is in a list

You're welcome. If you're caught in such a nasty mess in the future,
consider preceding such a line with
s$ = Right(stContents, 1)
if efficiency matters.

You still can do better than that long ugly statement even when the
letters are not fully contiguous (exactly A through F). You could put
each valid letter in a range, like
A
C
D
F

and do a isna(vlookup) - or even better, do a more efficient match<0.
But you'd probably like using CHOOSE best of all - I'll let you
experiment with it.

But like you I'd have preferred something like "BETWEEN" or SQL's "IN"