View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Man in the middle

I am using Office 2003 on Windows XP.

In code, I need to work out which variable contains the middle value, in
this example, it would be 85. I would guess this needs to be done by
comparing <= and = and sometimes there could be a two or three way tie. In a
tie, it doesn't matter which one is in the middle...but the code needs to
identify which variable has been selected. So in the example, I would need to
know that dVar1 is in the
middle.

Dim dVar1 as Double
Dim dVar2 as Double
Dim dVar3 as Double
dVar1 = Abs(-85)
dVar2 = Abs(95)
dVar3 = Abs(25)

If dVar1 = dVar2 then ... (what next? I can't crack it!)

Do I have to try every combination to work this out? I can't seem to work
out the code to ensure that it always works. Your help is appreciated.