PC Review


Reply
 
 
Shaz
Guest
Posts: n/a
 
      20th Sep 2004
Hello
I have a table of data.
I would like to sort a column using a macro however the column is
determined by the cell selected. Is this possible.

Shazz
 
Reply With Quote
 
 
 
 
Nick Hodge
Guest
Posts: n/a
 
      21st Sep 2004
Shazz

If the table is contiguous from cell A1 the code below will work

Sub SortBySelected()
Range("A1").CurrentRegion.Sort Key1:=Range(ActiveCell.Address), _
Order1:=xlAscending, Header:=xlGuess
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(E-Mail Removed)HIS


"Shaz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
> I have a table of data.
> I would like to sort a column using a macro however the column is
> determined by the cell selected. Is this possible.
>
> Shazz



 
Reply With Quote
 
Shaz
Guest
Posts: n/a
 
      22nd Sep 2004
Nick
Many many thanks - worked a treat!!!


Shaz
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort without including column headings in sort OPDvolunteer Microsoft Excel Misc 4 11th Mar 2009 04:08 PM
Auto-Sort Won't Sort All Column Cells TikiTembo Microsoft Excel Misc 1 25th Mar 2008 07:00 PM
data, sort option is grayed. how to sort on a column? Steve Richter Microsoft Excel Misc 1 25th Sep 2007 03:25 PM
Crosstab Query: Sort Column heading based on other column sort Kaur Microsoft Access Reports 7 23rd Dec 2005 06:10 PM
How can I sort one column and have the entire row sort. (binding) =?Utf-8?B?Qmx1ZQ==?= Microsoft Excel Worksheet Functions 10 13th Nov 2005 07:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:44 AM.