Looking for help with a sorting macro.

T

thisisbowling

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.
 
G

Guest

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
 
M

matthew.webb

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.
 
M

matthew.webb

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.Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top