Sorting data on button click

J

John

Hi guys !

I have one sheet with cca 400 rows, divided in columns like name, date,
location, number etc.

Now, what i want to do is to create something like in windows explorer.
One "menu" where you can click on name, size, type, date modified etc.
and on click, columns should be sorted ascending or descending. The same
as in windows explorer....

How to make this ?
 
D

Dave Peterson

If you're using xl2003 (or higher), you can apply data|filter|autofilter.
There's an option under each arrow that allows you to sort the filtered range by
that field.

If you're using any version of excel, you can use a technique at Debra
Dalgleish's site:
http://contextures.com/xlSort02.html

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top