Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Automatic sorting

Please can someone tell me if it is possible to automatically sort data in
the same column?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Automatic sorting

Previously posted by Gary's Student:

This is just an example that you can adapt to suit your specific worksheet.
After installing the macros, run StartTimer. It will re-sort column A every
30 seconds. To stop this repeated re-sorting, just run StopTimer:

Public whn As Double
Public Const T = 30
Sub SortA()
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
StartTimer
End Sub
Sub StartTimer()
whn = Now + TimeSerial(0, 0, T)
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=False
End Sub


Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary''s Student - gsnu200822
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Please can someone tell me if it is possible to automatically sort data in
the same column?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Automatic sorting

Thanks for that. Is using a macro the only way?

"Luke M" wrote:

Previously posted by Gary's Student:

This is just an example that you can adapt to suit your specific worksheet.
After installing the macros, run StartTimer. It will re-sort column A every
30 seconds. To stop this repeated re-sorting, just run StopTimer:

Public whn As Double
Public Const T = 30
Sub SortA()
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
StartTimer
End Sub
Sub StartTimer()
whn = Now + TimeSerial(0, 0, T)
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=False
End Sub


Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary''s Student - gsnu200822
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Please can someone tell me if it is possible to automatically sort data in
the same column?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Automatic sorting

Pretty much. The one alternative is if you're sorting numbers, you could
setup a second column with
=LARGE(A1:A100,1)
=LARGE(A1:A100,2)
.....

where the number represents which n-th highest value you want. But this
method would be tedious to setup.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Thanks for that. Is using a macro the only way?

"Luke M" wrote:

Previously posted by Gary's Student:

This is just an example that you can adapt to suit your specific worksheet.
After installing the macros, run StartTimer. It will re-sort column A every
30 seconds. To stop this repeated re-sorting, just run StopTimer:

Public whn As Double
Public Const T = 30
Sub SortA()
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
StartTimer
End Sub
Sub StartTimer()
whn = Now + TimeSerial(0, 0, T)
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=False
End Sub


Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary''s Student - gsnu200822
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Please can someone tell me if it is possible to automatically sort data in
the same column?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Automatic sorting

Thanks Luke, I'll use the macro.

"Luke M" wrote:

Pretty much. The one alternative is if you're sorting numbers, you could
setup a second column with
=LARGE(A1:A100,1)
=LARGE(A1:A100,2)
....

where the number represents which n-th highest value you want. But this
method would be tedious to setup.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Thanks for that. Is using a macro the only way?

"Luke M" wrote:

Previously posted by Gary's Student:

This is just an example that you can adapt to suit your specific worksheet.
After installing the macros, run StartTimer. It will re-sort column A every
30 seconds. To stop this repeated re-sorting, just run StopTimer:

Public whn As Double
Public Const T = 30
Sub SortA()
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
StartTimer
End Sub
Sub StartTimer()
whn = Now + TimeSerial(0, 0, T)
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=whn, Procedu="SortA", Schedule:=False
End Sub


Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To use the macro from the normal Excel window:

1. ALT-F8
2. Select the macro
3. Touch Run



To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary''s Student - gsnu200822
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"SueG" wrote:

Please can someone tell me if it is possible to automatically sort data in
the same column?

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
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
automatic sorting bkunes Excel Worksheet Functions 4 February 20th 08 12:59 AM
Automatic sorting [email protected] Excel Worksheet Functions 0 June 26th 07 09:24 PM
Automatic Sorting Blade370 Excel Discussion (Misc queries) 1 March 20th 07 12:20 PM
automatic sorting gmisi Excel Worksheet Functions 3 October 11th 06 11:33 PM


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