View Single Post
  #2   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

On Mon, 18 Aug 2003 10:58:13 +0100, wrote:

I thought I would be able to do

If Right(stContents, 1) between "A" to "F" Then ....

but it doesn't like that for some reason.


You'll be pleased when you test the following in the Immediate (debug)
window:
?"F"<"G"
?"G"<"F"

Ergo
If Right(stContents, 1) = "A" And Right(stContents, 1) <= "F" Then

Your real challenge will be to have data that is that consistent enough
to fit your "rule." I have found that the consistency of street
addresses in a database can be nasty.