I do not use MS Project but I do a lot of work on data extracted from Project. I'm trying to use two custom functions in Project but can't figure out how to implament them. I would like to customize a Project Number field and a Text field with the two functions below. Both functions would use the Project field "Outline Number" as their attribute.
Text8 field customized with this formula WBSSortKey([Outline Number])
Number8 field customized with this formula SortKey([Outline Number])
Is this possible? If so how do I go about getting it done?
Thank you for your time.
Function WBSSortKey(v As Variant) As String
Dim s() As String, i As Integer
s = Split(v, ".")
WBSSortKey = Format(s(0), "000|")
For i = 1 To UBound(s)
If i > 0 And CInt(s(i)) > 99 Then
WBSSortKey = "#VALUE!"
WBSSortKey = WBSSortKey & Format(s(i), "00")
Function SortKey(rg As Range) As Double
Const dot As String = "."
Const NullString As String = ""
Const MaxLevels As Long = 4 'Maximum number of levels
Const MaxSubLevels = 99 'Maximum number of sublevels in each level; must be 10^x-1
Dim i As Long
temp = Split(rg.Text, dot)
For i = 0 To UBound(temp)
SortKey = SortKey + temp(i) * 10 ^ (((MaxLevels - 1) - i) * Log(MaxSubLevels + 1) / Log(10))