Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Expanding Outline and showing Levels

Posted on 2015-01-12
9
Medium Priority
?
58 Views
Last Modified: 2015-01-14
EE Pros,

I have a WS that has a macro that expands (rotates) through different levels of Outline.  What I'm trying to do is get the macro to not only expand through the levels when the button is pressed, but to display a name for each level.  I have worked on this for several hours and can't seem to get the link between the name of the level and the action.

Thank you in advance.

B.
Outline-Expand-Case.xls
0
Comment
Question by:Bright01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40544317
Can you elaborate on what you want to happen? Your code doesn't make a lot of sense as it stands - are parts of it missing?
0
 

Author Comment

by:Bright01
ID: 40544400
Rory,

There are no parts missing; however you can see I was trying to figure out what was referencing what in order to get the results.

As for the results I'm looking for;

1.) When you fire the macro from the button, it should change the outline level.
2.) The outline levels are named (e.g. Functional Areas, KPIs and Questions) and the name should show up on the button as the macro is fired.

This produces a way of viewing the data as the outline expands and then cycles back.

Does that make sense?

Thank you again for jumping in here.

B.
0
 

Author Comment

by:Bright01
ID: 40547512
Rory,

Greetings.  I found another part of the model I'm trying to re-create and in addition to what I sent you, it had a "Functions" module.  I have now added it.  This original model was for a two tiered outline.  The one in the model I'm trying to get to work with you is a three tiered model.  Based on what I have sent, I hope you can make sense of what it is suppose to do.  The assigned names are not correct so I continue to get an error, but hopefully you can follow the logic and make several simple corrections or additions.

Again, thank you for the help.

B.
D--Data-Data-Temp-Outline-Expand-Case-v2
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40548476
Do you mean something like this:

Option Explicit
Const SumBtnCaps As String = "Functional_Areas,KPIs,Questions"

Private Sub CmdSummary_Click()
    Dim vMatch
    vMatch = Application.Match(Cmdsummary.Caption, Split(SumBtnCaps, ","), 0)
    If Not IsError(vMatch) Then
        Me.Outline.ShowLevels RowLevels:=vMatch
        Cmdsummary.Caption = Split(SumBtnCaps, ",")(vMatch Mod 3)
    End If
End Sub

Open in new window

0
 

Author Comment

by:Bright01
ID: 40548639
Wow!  That's exactly what I was looking for!  That was outstanding diagnosis and work!  I didn't give you much to go on but you figured it out.  Thank you very much.

One question; if I want to change the order of when you see the results on the button, do I simply change the order on this line?

Const SumBtnCaps As String = "Functional_Areas,KPIs,Questions"

Thanks again,

B.
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40548657
No - the code just matches the current caption against the list and uses that position for the RowLevels argument. If you need a different order, you'll need a slightly different approach; you can use two constants like this as long as you keep them in sync:

Option Explicit
Const SumBtnCaps As String = "Functional_Areas,KPIs,Questions"
Const ShowLevels As String = "1,2,3"

Private Sub CmdSummary_Click()
    Dim vMatch
    vMatch = Application.Match(Cmdsummary.Caption, Split(SumBtnCaps, ","), 0)
    If Not IsError(vMatch) Then
        Me.Outline.ShowLevels RowLevels:=CLng(Split(ShowLevels, ",")(vMatch))
        Cmdsummary.Caption = Split(SumBtnCaps, ",")(vMatch Mod 3)
    End If
End Sub

Open in new window

0
 

Author Comment

by:Bright01
ID: 40548695
OK....but I'm getting a slight "debug" error.  WB attached.

B.
D--Data-Data-Temp-Macro-for-Outline-Expa
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 40548738
Apologies, I forgot the 0 basing:

        Me.Outline.ShowLevels RowLevels:=CLng(Split(ShowLevels, ",")(vMatch))

Open in new window

should be:

        Me.Outline.ShowLevels RowLevels:=CLng(Split(ShowLevels, ",")(vMatch - 1))

Open in new window

0
 

Author Closing Comment

by:Bright01
ID: 40548751
Like a charm!  Thank you very much!  Great work without much to go on.

B.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question