How to automate setting up groups for expanding and collapsing rows

lrutt

Board Regular
Joined
Jan 12, 2016
Messages
103
I have a routine that imports a Microsoft project plan. That all works perfectly.

I'd like to create some VBA code that would apply the "+" and "-" to collapse and expand groups based on the WBS code.

I'd like a "+" by the 1, 1.1, 1.1.1, 1.2, 1.3 and so on depending on the indent level when imported. That way I can hide sections that either are complete in the project or that may not be in play yet. I think it could/would be dependent on possibly counting the periods "." in the string in the WBS column but can't wrap my head around doing that with the nested situation this presents. It's possible there could be 7 or more levels.

Any help would be appreciated.

Those WBS codes look as follows for example:

0
1
1.1
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.2
1.2.1
1.2.2
1.2.3
1.3
1.3.1
<colgroup><col width="176" style="width: 132pt; mso-width-source: userset; mso-width-alt: 6257;"> <tbody> </tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
As a project plan can be several hundred lines long, I need to keep this in the worksheet. I apply some conditional formatting etc. as the lines are imported to facilitate readability. I would also need to be able to create a .pdf of the worksheet with groups collapsed etc.

If there are options to do this within the worksheet, that is what I need.

Thanks
 
Upvote 0
if you structure your table like below then with a pivot table you can do this

DIGyVrh.jpg
 
Upvote 0
Unfortunately the MS Project import routine takes the WBS straight from the project plan and copies it into a column. I need to try and work with the single column as shown.
 
Upvote 0

Forum statistics

Threads
1,215,365
Messages
6,124,511
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top