J
John4bank
In project I have developed a macro that burdens a base salary rate with
different overhead rates. My problem is that if someone had previously
entered a rate to take effect on the same day as the new burdens take effect
I cannot overide the old rate.
Is there a way to cycle through all of the resources on the resource sheet
and delete all rate changes on ____ date or is there a way to simply replace
them as the macro cycles through?
My current code looks like:
FringeNum = Val(SFringe)
CRate =
Rsr.CostRateTables("A").PayRates.Item("1").StandardRate
CRate = Replace(CRate, "$", "")
CRate = Replace(CRate, "/h", "")
MValue = Val(CRate)
aSNum = ((((SwitchNum + FringeNum) * MValue) / 100)) + MValue
GANum = (aSNum * GAb)
SNumber = CStr(GANum)
Rsr.CostRateTables("A").PayRates.Add iDate, SNumber,
SNumber, "0"
However, if there is already an entry on the same day as "iDate" the code
fails (last line of code).
Also, in the second line of the code I have "...Item("1")..." I know I am
not supposed to use a "1" there, but I am not sure how to call the first
entry of rsouce table A. How would I call the first entry?
different overhead rates. My problem is that if someone had previously
entered a rate to take effect on the same day as the new burdens take effect
I cannot overide the old rate.
Is there a way to cycle through all of the resources on the resource sheet
and delete all rate changes on ____ date or is there a way to simply replace
them as the macro cycles through?
My current code looks like:
FringeNum = Val(SFringe)
CRate =
Rsr.CostRateTables("A").PayRates.Item("1").StandardRate
CRate = Replace(CRate, "$", "")
CRate = Replace(CRate, "/h", "")
MValue = Val(CRate)
aSNum = ((((SwitchNum + FringeNum) * MValue) / 100)) + MValue
GANum = (aSNum * GAb)
SNumber = CStr(GANum)
Rsr.CostRateTables("A").PayRates.Add iDate, SNumber,
SNumber, "0"
However, if there is already an entry on the same day as "iDate" the code
fails (last line of code).
Also, in the second line of the code I have "...Item("1")..." I know I am
not supposed to use a "1" there, but I am not sure how to call the first
entry of rsouce table A. How would I call the first entry?