Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting in EXCEL 2

Status
Not open for further replies.

ottograham

Technical User
Mar 30, 2001
109
0
0
US
When I sort in Access, all columns stay associated with the corresponding sort column, but in Excel it is easy to rearrange a column and not change the other related columns.

Is there a way to link columns and prevent the accidental mix up of row data?
 
The linking is dynamic by xl. If you click in a cell not a row the default in xl is to ask if you want all the data. All the data as I remember looks for any data that has data beside it. i.e. If you leave blank rows or colums the data will be truncated.

Another safe way is to highlight all of the data to be sorted together then invoke the sort function.

Good luck
DW
 
Hi,
Another thing to be aware of is that if you happen to have an EMPTY COLUMN or ROW,

the SORT STOPS THERE!
Skip,
metzgsk@voughtaircraft.com
 
That works ok - I was highlighting the column header which messed things up.

Stars to both of you - I'm getting an error message when I try to mark the posts as helpful.

Thank you...
 
ottograham,

It appears your immediate problem has been resolved.

If, however, you would be interested in "expanding" your knowledge of the "sorting" function, or "extraction" of data and then sorting the extracted data, then I have an example model I just created specifically for your situation.

Sometimes it is desirable to sort the data in the SAME location. However, in other cases, it is preferable to "leave the existing data untouched", and instead extract either all or sometimes "selected" data to a separate sheet, where it is sorted.

The example file contains VBA code (attached to buttons) for both "sorting in place", and also for "extracting" and then sorting. The extraction "criteria" will provide a useful example of how you can be "selective" in extracting out ONLY the records you wish, and ONLY the columns you wish, in the "column order" you wish.

If you're interested, email me and I'll attach the file via return email.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top