Jun 24 2021 05:03 PM
Hello,
I'm pretty sure the answer is that this can't be done but I thought I would ask in case someone smarter than me has a way.
Is it possible to set a variable that refers to a field and use that variable for field manipulation later?
For example:
FieldVar=Text1
For each oTask in ActiveProject.Tasks
Debug.Print oTask.FieldVar
oTask.FieldVar = oTask.FieldVar & "-Reported"
Next oTask
The reason for the question is that different PMs use custom fields for different purposes and I'm looking at having some utilities that could be portable if they could use different fields like that. I could simply change the variable assignment (such as FieldVar=Text8) and the rest of the code would not need changing.
The alternative being I just set fixed fields to use and the PMs have to adapt.
I could use CASE statements or compiler directives to achieve but this would lead to huge unwieldly code. I was hoping there would be a smarter way.
Jun 24 2021 07:37 PM
Solution