Cost Rate Table with VBA

B

BF2K

I would like to create a macro to loop thru all resources and provide
new cost (in cost rate table A) that would become effective on 1/1/08
Is there a way to do this with VBA?
I tried recording a macro, but when I do so I get only:

Sub Macro1()
SelectResourceField Row:=0, Column:="Standard Rate"
End Sub

Ie, no actual updating of entries is recorded by the macro.

Any suggestions would be appreciated.

Thanks,

Bo
 
M

Mike Glen

Hi Bob,

Try posting on the developer newsgroup. Please see FAQ Item: 24. Project
Newsgroups. FAQs, companion products and other useful Project information
can be seen at this web address: http://project.mvps.org/faqs.htm

Mike Glen
Project MVP
 
J

John

BF2K said:
I would like to create a macro to loop thru all resources and provide a
new cost (in cost rate table A) that would become effective on 1/1/08.
Is there a way to do this with VBA?
I tried recording a macro, but when I do so I get only:

Sub Macro1()
SelectResourceField Row:=0, Column:="Standard Rate"
End Sub

Ie, no actual updating of entries is recorded by the macro.

Any suggestions would be appreciated.

Thanks,

Bob

Bob,
This is a case where simply recording a macro doesn't help much.
However, the code to do what you want is fairly straightforward. Try the
following (it assumes a new rate of $50/hr on 1/1/08):

Sub Update_Rates()
Dim r As Resource
For Each r In activeproject.Resources
If r.Type = pjResourceTypeWork Then
r.CostRateTables("A").PayRates.Add EffectiveDate:="1/1/08",
stdrate:=50
End If
Next r
End Sub

This simple version assumes there is not an existing rate that is
effective on 1/1/08.

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