I need to be able to sort data based on the number in col A but I have merged cells in the range and also outlines that I want to keep intact and move with the data. Any ideas? I have added the example.
I need to be able to sort data based on the number in col A but I have merged cells in the range and also outlines that I want to keep intact and move with the data. Any ideas? I have added the example.
Using Merged Cells especially with VBA will always cause problems. Avoid them, try using Centre across selection instead.
Your spreadsheet design is not compatible with Excel's Sort feature.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Hello Markdill,
After looking at your workbook, I didn't find any merged cells. Did you post the correct workbook? Are you wanting to sort only the STC# values in column "A" that are outlined?
Thanks,
Leith Ross
Leith,
You are right I removed them thinking it was messing up the sort.
Yes I want to sort the data by COL. A "SCT#" but I want to keep the data in all of the rows the way it is just sort/move the blocks of data if you will. That is the hard part with the outlines.
So the data is made up of many blocks i.e. - A7 to L9 is one of these "Blocks" and as you can see they are just copied and then the data is changed or added in them.
I want to sort these "blocks" by the value in COL. A but keep the data in the blocks, maybe move the blocks? I do not know.
I know how to do a normal sort but the way I need to keep the data in the same location within the blocks and just move/sort the blocks depending on COL. A is what has me stumped.
Thank for your help.
Hello Markdill,
Should I use the workbook you posted originally, or wait for you to post another copy with the merged cells?
Sincerely,
Leith Ross
You can use the one I sent, that is the one that is the most current. Feel free to edit it as you need to get it working.
Thanks
Hello Markdill,
The macro below sorts the data and copies it to the worksheet named "Sorted Data". The original data remains intact. The macro shown here has been installed in the attached workbook. By the way, the merged cells pose no sorting problem for this macro.
Sincerely,![]()
Please Login or Register to view this content.
Leith Ross
Last edited by Leith Ross; 09-07-2007 at 03:26 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks