C
colin_e
I have a table that represents information in an outline structure.
The table has two columns, "Level" and "Requirement" that look like this-
Level Requirement
1 Top Level
2 Next Level
2 Next Level again
3 Further sublevel
2 Back to Level 2
Now, what I want to two functions that will-
1) Set the indents of the "Requirements" column based on the level numbers,
or-
2) Se the Level numbers based on the indents of the Requirements column.
Sounds easy, And one way it is!
Can anyone explain why this works perfectly-
Dim oSh As Worksheet
Set oSh = ActiveSheet
oSh.Range("Reqts[Requirement]").IndentLevel =
oSh.Range("Reqts[Level]").Value
But the converse just sets all the "Level" values to zero?-
Dim oSh As Worksheet
Set oSh = ActiveSheet
' This should work but doesn't
' oSh.Range("Reqts[Level]").Value =
oSh.Range("Reqts[Requirement]").IndentLevel
I've got around it using a For Each loop for the second case, but the lack
of consistency bothers me. Is there a good reason why this works one way but
not the other?
The table has two columns, "Level" and "Requirement" that look like this-
Level Requirement
1 Top Level
2 Next Level
2 Next Level again
3 Further sublevel
2 Back to Level 2
Now, what I want to two functions that will-
1) Set the indents of the "Requirements" column based on the level numbers,
or-
2) Se the Level numbers based on the indents of the Requirements column.
Sounds easy, And one way it is!
Can anyone explain why this works perfectly-
Dim oSh As Worksheet
Set oSh = ActiveSheet
oSh.Range("Reqts[Requirement]").IndentLevel =
oSh.Range("Reqts[Level]").Value
But the converse just sets all the "Level" values to zero?-
Dim oSh As Worksheet
Set oSh = ActiveSheet
' This should work but doesn't
' oSh.Range("Reqts[Level]").Value =
oSh.Range("Reqts[Requirement]").IndentLevel
I've got around it using a For Each loop for the second case, but the lack
of consistency bothers me. Is there a good reason why this works one way but
not the other?