View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RTB RTB is offline
external usenet poster
 
Posts: 1
Default VBA date in function

Hello,
I've been reading the posting and have found them to be very
informative in learning VBA. However, i have not been able to find
this:

i currently have a commission function that works great, but i can
only figure out how to get a quarterly number from it when i change
the date manually.

for example:
This is for Q3 '04
Function fee(Assets)
' schedule investment management fee
Const tier1 = 0.01 * (92 / 365)
Const tier2 = 0.01 * (92 / 365)
Const tier3 = 0.01 * (92 / 365)
Const tier4 = 0.01 * (92 / 365)
Const tier5 = 0.01 * (92 / 365)
' calculates annual management fee
Select Case Assets
Case 1 To 499999.99
fee = Assets * tier1
Case 500000 To 999999.99
fee = 500000 * tier1 + (Assets - 500000) * tier2
Case 1000000 To 1999999.99
fee = 500000 * tier1 + 500000 * tier2 + (Assets - 1000000)
* tier3
Case 2000000 To 5000000
fee = 500000 * tier1 + 500000 * tier2 + 1000000 * tier3 + _
(Assets - 2000000) * tier4
Case Is = 5000000
fee = 500000 * tier1 + 500000 * tier2 + 1000000 * tier3 + _
3000000 * tier4 + (Assets - 5000000) * tier5
End Select
End Function

how would i make the date 92 update to 91 in the next quarter Q1 '04
(90 days)(based on excels date format) and the future q1,q2,q3,q4?
But still have the history
Can this happen or is it a pipe dream?
thanks,
RTB