Archive of Mr Excel Message Board
Back to General Excel archive index
Back to archive home
Locking a row for sortingPosted by Tee Jay on August 11, 2001 8:21 AM
I have an overtime list that I wish to be able to sort in order of highest or lowest total hours. I am having trouble "locking" the data in their respective rows in order to sort the employees, and all of thier data, by total number of hours.
When I try to sort them by total hours, only that column sorts and then you have to undo to get the data to return to the correct employees row. I hope that made sense.
Is there a way to lock each row so that the data in each row stays together regardless?
Sorry for such a simple question. I am a new Excel user. Thanks for this board.
Re: Locking a row for sortingPosted by Caleb on August 11, 2001 7:30 PM
Well, in order to sort correctly, you need to select *all* the columns that pertain to your data, not just the one with the sort criteria in it. So if you have data in columns A-F and your sort criteria are in column D, you select columns A-F, (click and drag from A1 through Fwhatever (bottom right), then sort by column D (or the title of the column if you have one). Does this help?
Re: Locking a row for sortingPosted by Tee Jay on August 12, 2001 10:11 AM
I will try what you reccomended. I am hoping to set this up to sort this automatically. As I said before, this is for an overtime list. The person with the fewest hours is the first to be called so I want it to keep "John Doe's" row together and separate from "John Q. Public's" data. I already have it figuring the hours worked and hours charged correctly.
But now I want to be able to sort the list of rows by one column (the total hours column) in order to keep the man with low hours on the top of the list. When I do it now, it will sort the total hours column but the rest of the columns remain unaffected. So I am hoping to keep each man's row separate and intact at all times. And if I copuld make it sort the total hours column automatically that would be perfect. Is there a way to do this?
I hope I have explained this well enough. And thank you very much for your help.
This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store
to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.