Inconsistent behaviour of attributes accessed through structured r

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top