Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kev Kev is offline
external usenet poster
 
Posts: 46
Default Is this possible?? Please help

I need to be able to click on my column titles to have the rows sorted by the
information in those colums.

Like in a windows file, Click on date created or auther etc.

So is it possible?? and does this have a name??

Please help i an sooo stuck.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Is this possible?? Please help

Right click sheet tabview codeinsert thismodify to suit your range.
Now when you double click on any cell in the desired column the range will
be sorted by that column.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
ac = ActiveCell.Column
Range("A2:B6").Sort Key1:=Cells(3, ac), Order1:=xlAscending
End Sub

--
Don Guillett
SalesAid Software

"Kev" wrote in message
...
I need to be able to click on my column titles to have the rows sorted by
the
information in those colums.

Like in a windows file, Click on date created or auther etc.

So is it possible?? and does this have a name??

Please help i an sooo stuck.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 751
Default Is this possible?? Please help

On Jun 1, 3:53 pm, Kev wrote:
I need to be able to click on my column titles to have the rows sorted by the
information in those colums.

Like in a windows file, Click on date created or auther etc.

So is it possible?? and does this have a name??

Please help i an sooo stuck.


This VBA Event macro will do:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:F1")) Is Nothing Then
Range("A1:F100").Sort Key1:=Target, Order1:=xlAscending, Header:=
_
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

It assumes that your titles are in A1:F1 and the table will not be
longer than A1:F100. Change these to suit. Then:

Right click on the sheet tab. Choose View Code... This will take you
to the VBA IDE. Paste the above code in the window.

HTH
Kostis Vezerides

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Is this possible?? Please help

Hi

Dave Peterson has created a nice utility using shapes to ensure the
correct set of data is captured for the sort.
This can be downloaded from
http://www.contextures.com/xlSort02.html
--
Regards

Roger Govier


"Kev" wrote in message
...
I need to be able to click on my column titles to have the rows sorted
by the
information in those colums.

Like in a windows file, Click on date created or auther etc.

So is it possible?? and does this have a name??

Please help i an sooo stuck.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"