VBA Grouping Rows

Littlemalky

Board Regular
Joined
Jan 14, 2011
Messages
223
I have a report I do that has part numbers in column "J", then a break in rows and a group that is hidden below with more part numbers in it. I have the code that shows all data for column "J" so that it unhides the group and I can copy those part numbers. Is there any way to hide that group of rows if the amount of rows are always changing within that group?

It's the only group of rows in column "J", if that helps. Simply, "Visible = False" with the exact range isn't good enough for me at this point.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You can show or hide all existing groups by level. Is that what you want?
 
Upvote 0
Maybe:
Code:
ActiveSheet.Outline.ShowLevels RowLevels:=1, ColumnLevels:=0

... I'm guessing, as I can't actually see your layout.
 
Upvote 0
You said "then a break in rows and a group that is hidden below " ... that macro code makes groupings in Rows collapse to level 1.
 
Upvote 0
I get it!! Sorry, I never really grouped rows together before and didn't realize the outline part where it has the "1" and the "2". I just tested the code and it works perfectly. I really appreciate your help!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

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