Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting data automatically


Hello All, Hope someone can help...

I have a table in excel, range: c11:h584 where row C11:H11 contains th
titles.
What I would like to do is automatically sort the column by row G.

I may want to change the macro to sort on different columns - is i
possible to build this into the macro using a msgbox (for example)

Is there a way to automate this sort function ?

Many thanks for your help.
Regards

Scott

--
scottwilson
-----------------------------------------------------------------------
scottwilsonx's Profile: http://www.excelforum.com/member.php...fo&userid=1112
View this thread: http://www.excelforum.com/showthread.php?threadid=26272

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting data automatically

Turn on the macro recorder and select the range, then do Data=Sort and
select Column G.

Turn off the macro recorder.

Now you c
an replace the Key1:=Range("G11") with a variable such as
dim rng as Range
On error resume next
set rng = Application.Inputbox("Click mouse on a cell in the column to use
for sorting",type:=8)
On error goto 0
if not rng is nothing then
Range("C11:H584").Sort _
Key1:=rng, Order1:=xlascending, _
headers:=xlYes
Else
Msgbox "Nothing selected, bye"
exit sub
End if

--
regards,
Tom Ogilvy

"scottwilsonx" wrote in message
...

Hello All, Hope someone can help...

I have a table in excel, range: c11:h584 where row C11:H11 contains the
titles.
What I would like to do is automatically sort the column by row G.

I may want to change the macro to sort on different columns - is it
possible to build this into the macro using a msgbox (for example)

Is there a way to automate this sort function ?

Many thanks for your help.
Regards

Scott.


--
scottwilsonx
------------------------------------------------------------------------
scottwilsonx's Profile:

http://www.excelforum.com/member.php...o&userid=11128
View this thread: http://www.excelforum.com/showthread...hreadid=262722



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
Help with automatically sorting data Jim48762 Excel Worksheet Functions 1 April 29th 09 04:24 AM
Data sorting automatically? Tommy[_2_] Excel Worksheet Functions 10 March 24th 07 10:09 PM
Sorting Data Automatically Sabunabu Excel Worksheet Functions 2 January 4th 06 08:39 PM
Sorting data automatically Graham Mason Excel Worksheet Functions 2 May 21st 05 09:45 PM
Sorting Data Automatically Alan Bartley Excel Discussion (Misc queries) 1 December 8th 04 01:51 PM


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

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"