Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I need to sort an active sheet using the col of the active cell

My intent is to create a Sort Button that will read the Active Column for
sorting the ActiveSheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default I need to sort an active sheet using the col of the active cell

One way:
Sub SortByActiveCellColumn()
Selection.Sort Key1:=Cells(2, ActiveCell.Column), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
I assumed your data has headers. Also, you have to select the entire range
you want sorted before you run this macro. Post back if you want help with
refining this to work with what you actually have. HTH Otto
"HamFlyer" wrote in message
...
My intent is to create a Sort Button that will read the Active Column for
sorting the ActiveSheet.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default I need to sort an active sheet using the col of the active cell

Maybe you can use the technique shown at Debra Dalgleish's site:
http://www.contextures.com/xlSort02.html



HamFlyer wrote:

My intent is to create a Sort Button that will read the Active Column for
sorting the ActiveSheet.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default I need to sort an active sheet using the col of the active cel



"Otto Moehrbach" wrote:

One way:
Sub SortByActiveCellColumn()
Selection.Sort Key1:=Cells(2, ActiveCell.Column), _
Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
I assumed your data has headers. Also, you have to select the entire range
you want sorted before you run this macro. Post back if you want help with
refining this to work with what you actually have. HTH Otto
"HamFlyer" wrote in message
...
My intent is to create a Sort Button that will read the Active Column for
sorting the ActiveSheet.



Thanks Otto

That was just the clue I needed. All the other code is in place and working.
Thanks again
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
referring to formula in a non active cell from active cell nickname Excel Discussion (Misc queries) 1 June 21st 07 12:11 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
sort on not active sheet peter_bhp Excel Programming 4 December 25th 04 09:00 AM
If active cell found in another sheet axg275[_3_] Excel Programming 5 August 9th 04 10:52 PM


All times are GMT +1. The time now is 07:41 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"