"Auto" macro to hide columns based on otuline Row level selection?

jmthompson

Well-known Member
Joined
Mar 31, 2008
Messages
966
I've searched around and played with this some. What I'd like is to create a Worksheet macro for when the user picks a Outline Row level (on my subtotaled report), unused columns would be hidden.

Row level 5 = no hidden columns
Row level 4 = hide column D
Row level 3 = hide columns C & D
Row level 2 = hide columns B:D
Row level 1 = hide columns B:D

I can't figure out, first, how to use the current row level as a variable and secondly, what event I would use to launch the macro.
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,510
There is no event associated with changing outline levels. Would using the worksheet calculate event be acceptable?
 

jmthompson

Well-known Member
Joined
Mar 31, 2008
Messages
966
Hey Glenn,
Thanks for responding. That is the route I eventually took, but the code I wrote caused a lot of screen flicker that wasn't suppressed by Application.ScreenUpdating=False. Would have been cool if it were seamless, but I finally considered the audience for this report and decided to eliminate that step.

I started another thread to resolve the screen flicker- http://www.mrexcel.com/forum/showthread.php?t=539661
 

Watch MrExcel Video

Forum statistics

Threads
1,122,371
Messages
5,595,777
Members
414,020
Latest member
Meghdad

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
Top