Cost calculations

T

teach1

Hi

I have created a formula to calculate Resource Std Rate from Pounds to
Dollar and the result rate is in a new Cost field.

My problem is how do I show Dollar symbol and how do I retain whether its a
per day rate or a per week rate etc which is displayed in the Standard Rate
column.

Hope there is a way.

Regards
Teach1
 
J

John

teach1 said:
Hi

I have created a formula to calculate Resource Std Rate from Pounds to
Dollar and the result rate is in a new Cost field.

My problem is how do I show Dollar symbol and how do I retain whether its a
per day rate or a per week rate etc which is displayed in the Standard Rate
column.

Hope there is a way.

Regards
Teach1

Teach1,
I couldn't come up with a way to use a formula in a spare field, but the
macro below will give you what you want. In order to get the "$" symbol,
you have to use a spare resource text field. Trying to use a spare
resource cost field will now allow the "$" symbol, assuming your default
currency symbol is pound.

Sub PayRateConv()
Dim r As Resource
Dim rRat As String
Dim ConvFac As Single
ConvFac = 1.1
For Each r In ActiveProject.Resources
rRat = r.PayRates(1).StandardRate
cRat = Mid(rRat, 2, InStr(1, rRat, "/") - 2)
If InStr(1, rRat, "h") > 0 Then
r.Text1 = Format(cRat * ConvFac, "$#.00") & "/hr"
Else
r.Text1 = Format(cRat * ConvFac, "$#.00") & "/day"
End If
Next r
End Sub

Hope this helps.
John
Project MVP
 
T

teach1

Thanks John

John said:
Teach1,
I couldn't come up with a way to use a formula in a spare field, but the
macro below will give you what you want. In order to get the "$" symbol,
you have to use a spare resource text field. Trying to use a spare
resource cost field will now allow the "$" symbol, assuming your default
currency symbol is pound.

Sub PayRateConv()
Dim r As Resource
Dim rRat As String
Dim ConvFac As Single
ConvFac = 1.1
For Each r In ActiveProject.Resources
rRat = r.PayRates(1).StandardRate
cRat = Mid(rRat, 2, InStr(1, rRat, "/") - 2)
If InStr(1, rRat, "h") > 0 Then
r.Text1 = Format(cRat * ConvFac, "$#.00") & "/hr"
Else
r.Text1 = Format(cRat * ConvFac, "$#.00") & "/day"
End If
Next r
End Sub

Hope this helps.
John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top