I have been given a spreadsheet that lists a number of resources and the resource rates for each financial year for the next ten years. Each year starts on May 1st.
Every month there is the potential for these rates to change, maybe someone gets promoted for example, and their rates change.
I am trying to figure out a way that I can import the resource rates into the Resource Sheet in Microsoft Project from an Excel spreadsheet and have the resource rate Table A updated to reflect the new rates for each FY period (e.g. for the next ten years).
I know I need a macro to do this but I am unsure where to start. An import map doesn't seem to work.
My starting point was to use this code
Sub SetRateAfromEntField()
'Declare Variables
Dim Res As Resource
'Loop All Resources
For Each Res In ActiveProject.Resources
'Check for Real Resource
If Not (Res Is Nothing) Then
'Set Rate Table A from Std. Rate A
Res.CostRateTables(1).PayRates(Res.CostRateTables(1).PayRates.Count).StandardRate = Res.GetField(FieldNameToFieldConstant("Std. Rate A", pjResource))
End If
Next Res
End Sub
and assume the existence of a resource custom field that already contains the rate, and therefore I would need ten custom fields.
However, in my case the data resides in an Excel sheet. Each resource has a unique reference code (resCode) which exists in both the Excel sheet and in the resource pool for each resource.
I'm trying to figure out a way to directly read the rates in from the spreadsheet and have the resources rates updated on a periodical basis.
I saw this code which looks close but doesn't include the reference to the data being stored in an Excel spreadsheet from which the rates need to be read in. https://pm.stackexchange.com/questions/25019/ms-project-multi-year-inflation
In summary:
Resource Rates for each year for the next 10 years are stored in a spreadsheet.
Resources are uniquely mapped to a resource code (resCode) in both the Excel sheet and in project.
Rates need to be updated each month by running a macro to import the rates.
Any help on how best to achieve this would be gratefully received.