Select Case

IanT

Registered User.
Local time
Today, 16:50
Joined
Nov 30, 2001
Messages
191
Hi

I am using the code below to idntify minus figures, the code does not pick the minus figures up, any ideas why!

Function IncurredBand(Incurred)

Select Case Incurred
Case -1 To -500
IncurredBand = -500

Case -501 To -5000
IncurredBand = -5000

Case -5001 To -15000
IncurredBand = -15000


Case Else
IncurredBand = Incurred



End Select


End Function
 
Try this

Code:
Function IncurredBand(Incurred)

Select Case Incurred
    Case -500 To -1
        IncurredBand = -500
    Case -500 To -501
        IncurredBand = -5000
    Case -15000 To -5001
        IncurredBand = -15000
    Case Else
        IncurredBand = Incurred
End Select

End Function

Had your negative the wrong way round
 
Dcrake said:
Had your negative the wrong way round
I said that

Brian

No you didn't :D
Brianwarnock said:
The smallest value must come first

Looks like different words to me.
smiletongueout.jpg


(sorry, couldn't help myself - I know you MEANT the same thing)
 
No you didn't :D


Looks like different words to me.
smiletongueout.jpg


(sorry, couldn't help myself - I know you MEANT the same thing)

That's ok Bob it emphasises how more explanatory my words are, it states why they are the wrong way round. ;)

Brian
 

Users who are viewing this thread

Back
Top Bottom