Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Looking for help with a sorting macro.

Hello all,

Can anyone help me with a sort routine that goes through a sheet until
the data in column E stops but sorts blocks of data defined by a
'Total' string in Column F and sort by column G.

So to explain another way. Until data finishes in column E, look
between 'Total tags in Column F and sort by column G. I done the best
I can with an ilistration below, opast toa true t

a b c d e f g
1 - - - - a Total 81
2 - - - - b Total 35
3 - - - - c 15
4 - - - - d 10
5 - - - - e 5
6 - - - - f Total 46
7 - - - - g 2
8 - - - - h 18
9 - - - - I 26
10 - - - - J

Any help would be fantasic, I just don't know Excel well enough yet to
do this.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Looking for help with a sorting macro.

sub SortData()
Dim rng as Range, ar as Range
set rng = Range("F:F").specialCells(xlblanks)
for each ar in rng.Areas
ar.EntireRow.sort Key1:=ar(1).offset(0,1), _
Order1:=xlAscending, Header:=xlNo
Next
end sub

--
Regards,
Tom Ogilvy


" wrote:

Hello all,

Can anyone help me with a sort routine that goes through a sheet until
the data in column E stops but sorts blocks of data defined by a
'Total' string in Column F and sort by column G.

So to explain another way. Until data finishes in column E, look
between 'Total tags in Column F and sort by column G. I done the best
I can with an ilistration below, opast toa true t

a b c d e f g
1 - - - - a Total 81
2 - - - - b Total 35
3 - - - - c 15
4 - - - - d 10
5 - - - - e 5
6 - - - - f Total 46
7 - - - - g 2
8 - - - - h 18
9 - - - - I 26
10 - - - - J

Any help would be fantasic, I just don't know Excel well enough yet to
do this.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Looking for help with a sorting macro.

To help I've mock-up a document at "http://
www.inasentimentalmood.co.uk/Book1.xls" . From here I need to go
through the 'Sections' and sort the data by the Sales Column within
the section. Does anyone have suggestions on how best to approach
this problem, or better still, working code.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Looking for help with a sorting macro.

Okay, I can use this to select the groups of data but can Excel
recognise the clusters of rows and sort each group in turn?

Set myRg = Range([e10], [e65536].End(xlUp))
Set myRg = myRg.SpecialCells(xlCellTypeConstants).EntireRow.S elect

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 Macro for sorting Brad[_6_] Excel Worksheet Functions 2 August 10th 09 04:20 PM
sorting using macro Ross Excel Discussion (Misc queries) 2 September 15th 05 10:13 PM
macro for sorting cherrynich Excel Discussion (Misc queries) 1 December 30th 04 04:47 PM
Sorting with a macro? gschimek Excel Programming 2 August 29th 03 09:57 PM
sorting macro Beth Mc[_2_] Excel Programming 2 August 1st 03 03:49 AM


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

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"