Sorting with merged cells

liampog

Active Member
Joined
Aug 3, 2010
Messages
316
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi there

Is there REALLY no way to sort merged cells when the only solution to the spreadsheet I'm designing is to use them?

I have uploaded my spreadsheet to my webspace to make it easier for somebody to look at my spreadsheet and offer me some help if possible.

http://www.pogworld.co.uk/BlankBreakList.xls

The macro in question is "SortAllStaffByShiftStartTime". As you can see from the spreadsheet design, I need the cells in the C:K and L:O to be merged, because Rows 7 to 13 need the column widths to be as they are (value of 2.29).

If I didn't need to use the Rows 7 to 13 for anything, then I would simply change the C and L column widths to something suitable and then sorting would work perfectly.

The staff and shift listings on the right are able to be sorted because I have managed to just use one cell for all the data, but this doesn't work with the merged cells because the dropdown menus then appear too small.

Any ideas anyone?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi
Merge cells are the bane of ALL Excel users.
Instead of using merged cells, try this.
Unmerge the cells, Highlight the cells that were previously merged and then Format cells
Select the Alignment Tab and in the Horizontal dropdown select
"Center Across Selection"
It'll do the same thing, but you can work with the sheet much easier
 
Upvote 0
Unfortunately it doesnt really help me because

a) I don't want the data to be centred, but left-aligned
b) The data in the the merged cells is selected from a dropdown Data Validation method - by centring across selection, it makes the dropdown lists to small to see as the column width is small at 2.29 points.

If you look at the spreadsheet, you will see what I mean.
 
Upvote 0
Yes, I do see what you mean.
But the situation remains unchanged
There is REALLY no way to sort merged cells
About the only thing you can try is Unmerge, sort and then remerge manually.
Try recording a macro while you do it, but I think it will cause some positional issues.
 
Upvote 0
I tried that one... the macro takes ages to run :-(

I think I'm going to have to try to redesign the sheet from scratch.

Thanks for your help Michael, and prompt replies.
 
Upvote 0
How about relocating the dropdown list to above the header and then referencing to the cells you currently have.
You could then use "center across" and still be able to sort
 
Upvote 0
Sorry, I can't see your worksheet because my organisation in common with many others blocks file-sharing Web sites.

However if the worksheet isn't too big it's entirely possible to write a sort routine which re-orders worksheet rows by deleting and re-inserting them one at a time.

(It's actually possible to do this for any size of worksheet but it's not quick when used on large worksheets!)
 
Upvote 0
Just another point in your macro
I tried that one... the macro takes ages to run
When you created this macro, did you use, at the start of the code
Code:
Application.ScreenUpdating = False
AND, if there were a lot of calculations
Code:
Application.Calculation = xlCalculationManual
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,787
Members
452,942
Latest member
VijayNewtoExcel

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