ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sorting (https://www.excelbanter.com/excel-discussion-misc-queries/58528-sorting.html)

FloatingBubbles

Sorting
 
How do I go about setting up a single cell at the top of the worksheet that
with one click, it will sort the whole table? They have it set up to do that
with the worksheets at work and I'd like to be able to do it here at home.

j

Sorting
 
all you have to do is go to tools--macros--record macros

then you highlight either the whole table or just the column you want to
sort. when you're done, click on the stop button. save the macro.

go to the control toolbar and create a button. right click on the button and
go to view code. go to tools--macro and select your macro and click on
edit...highlight the text that's in black and insert that into the other
window which says private sub commandbutton1_click. save and this should be
it. the code should look something like this:

Private Sub CommandButton1_Click()
Cells.Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

"FloatingBubbles" wrote:

How do I go about setting up a single cell at the top of the worksheet that
with one click, it will sort the whole table? They have it set up to do that
with the worksheets at work and I'd like to be able to do it here at home.


T

Sorting
 
Hi
If your'e not into macros, there's an easier way:
Data-filter-autofilter.
Don't know if the're the same in english, but Data- then the second line,
then follow the arrow and then click the first line. I think this is what you
mean, it'll show a little button on the top of each row to sort the data.
Hop you can use it.
Therese


"FloatingBubbles" skrev:

How do I go about setting up a single cell at the top of the worksheet that
with one click, it will sort the whole table? They have it set up to do that
with the worksheets at work and I'd like to be able to do it here at home.


David McRitchie

Sorting
 
Whether you use a macro, do your sort manually, or use the sort button, or your own button
you probably want to select all cells on the worksheet or use cells. for the range;
otherwise you are putting your data at risk.

Read about sorting and why you do not want to select one cell, and use the
current range Ctrl+* based on a single cell.
http://www.mvps.org/dmcritchie/excel/sorting.htm
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"FloatingBubbles" wrote in message
...
How do I go about setting up a single cell at the top of the worksheet that
with one click, it will sort the whole table? They have it set up to do that
with the worksheets at work and I'd like to be able to do it here at home.





All times are GMT +1. The time now is 01:40 AM.

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