Paddy,
I created a 6 level functional hierachy and needed an automated WBS tool.
In my case I had each level in a separate column and the nodes listed in a
unique row. I am no excel guru but it does the job for me. In my case the
WBS entry column was A:A, B:B was a summary description of each node and the
range A1:I3 was heading information. Here is the VBA code:
****************************************
Sub WBS_Generator()
' Declare variables
Dim level_counter(7), row_no, no_nodes, array_index As Integer
Dim node_description, WBS_no As String
' Determine the number of nodes to process (first entry row is row 4)
row_no = 3: no_nodes = 0
Do
row_no = row_no + 1
node_description = Worksheets("System Architecture").Cells(row_no,
2).Value
If node_description <> "" Then no_nodes = no_nodes + 1
Loop Until node_description = ""
'For each node determine the column (ie, WBS level)
col_no = 2 ' first entry column is column 3
For row_no = 4 To no_nodes + 3
Do
col_no = col_no + 1
node_description = Worksheets("System Architecture").Cells(row_no,
col_no).Value
If node_description <> "" Then
level_counter(col_no - 2) = level_counter(col_no - 2) + 1
WBS_no = "" 'initialise WBS number
For array_index = 1 To col_no - 2
WBS_no = WBS_no & level_counter(array_index) & "." 'build
WBS number
Next array_index
Worksheets("System Architecture").Cells(row_no, 1).Value = "'" &
WBS_no
For array_index = col_no - 1 To 7
level_counter(array_index) = 0
Next array_index
col_no = 9 'exit loop for this row
End If
Loop Until col_no = 9
col_no = 2
Next row_no
End Sub
********************************
Cheers.