ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Sort Merged cells for worksheet? (https://www.excelbanter.com/excel-programming/436637-re-how-sort-merged-cells-worksheet.html)

Dave Peterson

How to Sort Merged cells for worksheet?
 
I think you're going to fail at this for the same reason it fails when you try
to do it manually.

Instead, I'd drop the merged cells completely and put the key value in each of
the cells A1:A5.

Personally, seeing those duplicated key values doesn't bother me at all--but it
sounds like it bothers you.

You can use conditional formatting to hide the duplicates.

Debra Dalgleish shows how:
http://contextures.com/xlCondFormat03.html#Duplicate

==========
I like seeing those duplicates--even when I apply data|filter and filter by that
column.



KMBrady wrote:

I'm looking for away to sort rows using VBA with merged cells.
Columns A - C

Rows in column A are merged (Value defines a group of rows)
Rows in B,C are not merged, and are associated with the Meged group in
column A
I'm trying to sort by the value in column A, and keep all associated rows
together

Example:
Group 1
A1:A5 are merged with a value of '1' (value of A1)
Column B1:C5 are not merged
Group 2
A6:A15 are merged with a value of '3' (value of A6)
Column B6:C15 are not merged
Group 3
A16:A20 are merged with a value of '2' (value of A16)
Column B16:C20 are not merged
Group 4 through Group x
same structure but column A could be any value

How can I sort the values in column A and keep the rows in each group
together?

Any thoughts are welcome
--
KMBrady


--

Dave Peterson


All times are GMT +1. The time now is 06:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com