Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rubix
 
Posts: n/a
Default Auto Sort using Macro

I wish to auto sort text and numbers in two columns and on 5 rows
descending. Is it possible to do this using Visual Basic?

Thanks,
Rube
  #2   Report Post  
Rubix
 
Posts: n/a
Default Auto Sort using Macro

Columns would be s & t. Rows 18-22

Rube
  #3   Report Post  
Ken Puls
 
Posts: n/a
Default Auto Sort using Macro

Hello,

This was paired down from a macro recording:

With ActiveSheet.Range("S18:T22")
.Sort Key1:=Range("S18"), Order1:=xlAscending, Header:=xlGuess
End With

If you wanted to sort by column T, change that in the second line of the
code.

Hope it helps,
--
Ken Puls
www.officearticles.com

"Rubix" wrote in message
...
Columns would be s & t. Rows 18-22

Rube



  #4   Report Post  
Rubix
 
Posts: n/a
Default Auto Sort using Macro

Thanks so much for your response.

I'm not sure if I am doing this right but in VBAProject under
ThisWorkbook I have:

Private Sub Workbook_Open()
With ActiveSheet.Range("S18:T22")
.Sort Key1:=Range("T18"), Order1:=xlDescending, Header:=xlGuess
End With
End Sub

This sorts column T but only when the spread sheet opens. I wish for
auto sorting while data is added.

Sorry I'm a newbie at this sort of thing.

Rube



On Sat, 12 Nov 2005 20:52:42 -0800, "Ken Puls"
wrote:

Hello,

This was paired down from a macro recording:

With ActiveSheet.Range("S18:T22")
.Sort Key1:=Range("S18"), Order1:=xlAscending, Header:=xlGuess
End With

If you wanted to sort by column T, change that in the second line of the
code.

Hope it helps,


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
Auto insert page breaks in Excel, based on a sort of numbers peterc89 Excel Discussion (Misc queries) 0 November 9th 05 03:41 PM
How to AUTO SORT A-Z new data in a column (not menual sorting) Nir Excel Worksheet Functions 2 November 8th 05 10:29 PM
Auto sort a linked sheet al Excel Worksheet Functions 1 October 26th 05 09:35 PM
Help:macro to auto sort data to different worksheets... 2nd Time Around Excel Discussion (Misc queries) 2 August 6th 05 12:31 PM
Leading zeros JC Excel Discussion (Misc queries) 9 February 1st 05 02:33 PM


All times are GMT +1. The time now is 09:24 PM.

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

About Us

"It's about Microsoft Excel"