LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Select Case Information Needed

possibly

Function CCDiscount(ContractValue)
Select Case clng(ContractValue)
Case Is < 0
CCDiscount = "Error < 0"
Case Is < 24000
CCDiscount = 0
Case Is < 33000
CCDiscount = 0.03
Case Is < 60000
CCDiscount = 0.05
Case Is < 120000
CCDiscount = 0.09
Case Is < 210000
CCDiscount = 0.15
Case Is < 600000
CCDiscount = 0.2
Case Is = 600000
CCDiscount = 0.3
Case Else
CCDiscount = "Error"
End Select
End Function

--
Regards,
Tom Ogilvy


"Richard Larson" wrote in message
...
I use the following function to calculate discounts on sales volumes. It
works but will still accept entries other than integers and will usually
show a 30% discount! The last message box must have a syntax error

also....
Any help would be appreciated....TIA


Function CCDiscount(ContractValue)
Select Case ContractValue
Case Is < 0
CCDiscount = "Error < 0"
Case Is < 24000
CCDiscount = 0
Case Is < 33000
CCDiscount = 0.03
Case Is < 60000
CCDiscount = 0.05
Case Is < 120000
CCDiscount = 0.09
Case Is < 210000
CCDiscount = 0.15
Case Is < 600000
CCDiscount = 0.2
Case Is = 600000
CCDiscount = 0.3
Case Else
CCDiscount = "Error"
End Select
End Function





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
select case in vba Hein Excel Discussion (Misc queries) 5 November 25th 09 07:28 AM
Case Select NoodNutt Excel Worksheet Functions 7 September 21st 08 02:10 AM
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Select Case Jeff Excel Discussion (Misc queries) 1 February 27th 06 02:56 PM
Need help on Select Case Susan Hayes Excel Worksheet Functions 1 November 3rd 04 10:25 PM


All times are GMT +1. The time now is 07:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"