View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Compare three strings?

How about something like:

Sub test()

a = 2
b = 1
c = 1

If Not Application.And(a = b, b = c, a = c) Then

MsgBox "different"
Else
MsgBox "same"
End If

End Sub

Good luck.

Ken
Norfolk, Va



On Feb 5, 5:16 pm, jayklmno
wrote:
Sometimes it's the little things that drive you crazy. I think I left my
brain at home.

How do you compare three strings? I want to make sure that none of three
variables are the same value. In a formula, I can do it, but the VBA code
seems to limit comparisons of only 2 at a time? Unless I'm missing something
simple. Any help?

Thanks in advance?