"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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
There is no event associated with changing outline levels. Would using the worksheet calculate event be acceptable?
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

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