View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default greater than but less than operators for VBA

... not sure how to write if its less than one amount but
greater than another...
Case Is = 300000 <= 4999999


Hi. You have excellent solutions. For future reference, I believe you
were looking for this:
Case 300000 To 5000000

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"jsr" wrote in message
ups.com...
I am new to working with VBA and I need some help. I am trying to
create a commission structure based on sales ranges - here is what I
have got - not sure how to write if its less than one amount but
greater than another (or vice versa)
any help is greatly appreciated....


Function clientcomm(sales) As Single
'calculates sales commissions based on client mgmt fees

Const comm1 As Double = 0.04
Const comm2 As Double = 0.05
Const comm3 As Double = 0.06
Select Case sales
Case Is = 5000000
clientcomm = sales * tier3
Case Is = 300000 <= 4999999
clientcomm = sales * tier2
Case Is < 2999999
clientcomm = sales * tier1
End Select



End Function