Group contiguous rows separately

Qqqqq

New Member
Joined
Feb 6, 2014
Messages
48
Is there a way to group rows that are next to each other separately? For example, can I get seperate groups for rows 6:14, 15:24, 25:34, and 35:44, without having Excel combine them into one single grouping?

I don't want to have insert a blank row between the groups. Here's why...

My worksheet has a header (rows 1:5), and sections below for each quarter. I only want to show the current quarter, and collapse each of the non-current quarters. If I leave a blank cell between each group, the first quarter information shows right under the header, but when I collapse the first quarter and show only the second quarter, the blank row creates a space between the header and the information. The third quarter has two rows between the header and the information, and the fourth quarter has a three row gap between the header and the information. The information is linked into a PowerPoint slide, and I want the spacing between the header and the information to be the same, regardless of which quarter's report is being displayed. It is also used in a printed report, which needs to be consistently formatted each quarter.

Is there a way to accomplish contiguous grouping, or perhaps a better way to do this? Having to manually group and ungroup each quarter feels like it defeats the convenience factor of grouping.
 
I tried the code in step 2 in a new worksheet (same workbook) and the message box popped up.
The same code inserted after the original code does not cause a message box to pop up.

Edit: I am such an idiot! I just realized that my date is in cell B3, not A3. Column A is very narrow and nearly invisible, and I forgot that the first column I actually see on this worksheet is B. I'm so accustomed to looking at it that I just overlooked the Headings. When I fixed the code to make the Target in B3, it worked perfectly. Thank you, Yongle. You're solution works exactly as I need, and you have been most patient.

I marked your code with the Like symbol. Let me know if there is anything else I can do to indicate this is solved.
 
Last edited:
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
No problem - my mistake was to assume that your value was in the correct cell
When will I learn not to assume anything?
Yet again it made an ass_ out of u and me ?
Thanks for the feedback - threads are not marked solved in this forum - so all is done
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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