Formular to sort a list of data

Clanangus

New Member
Joined
Mar 2, 2011
Messages
1
Hi

This is my first question posted on the forum. I've been reading it for ages and it has helped me out greatly just reading other peoples posts but now I have come across a problem I can't seem to find an answer to. Any help would be appreciated.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
What I am trying to do is to take a list of results similar to this...
<o:p></o:p>
<o:p></o:p>
ID - Depth - Value<o:p></o:p>
BH1 - 1 - 10<o:p></o:p>
BH1 - 1.5 - 9<o:p></o:p>
BH1 - 2 - 14<o:p></o:p>
BH2 - 1.5 - 12<o:p></o:p>
BH2 - 2 - 12<o:p></o:p>
BH3 - 2 - 15<o:p></o:p>
BH3 - 2.5 - 14<o:p></o:p>
<o:p></o:p>
And then produce separate lists somewhere in the same sheet that sort this data by ID producing separate lists like this....
.<o:p></o:p>
<o:p></o:p>
ID - Depth - Value <o:p></o:p>
BH1 - 1 - 10<o:p></o:p>
BH1 - 1.5 - 9<o:p></o:p>
BH1 - 2 - 14
.<o:p></o:p>
<o:p></o:p>
ID - Depth - Value<o:p></o:p>
BH2 - 1.5 - 12<o:p></o:p>
BH2 - 2 - 12
.<o:p></o:p>
<o:p></o:p>
ID - Depth - Value<o:p></o:p>
BH3 - 2 - 15<o:p></o:p>
BH3 - 2.5 - 14.
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
To complicate matters I need it to be a live formula so that when a new entry is put in the results list, it automatically appears correctly sorted. <o:p></o:p>
<o:p></o:p>
Any help and advice would be very kindly received<o:p></o:p>
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
try this macro "test" (mcro "undo" is to undo the result of the macro test)
the result is in sheet 2

Code:
Sub test()
Dim ra As Range, rfull As Range, rfilt As Range, run As Range, cun As Range, j As Integer
j = 0
Worksheets("sheet1").Activate
Set ra = Range(Range("A1"), Range("A1").End(xlDown))
Set rfull = Range("A1").CurrentRegion
Set run = Range("a1").End(xlDown).Offset(5, 0)
ra.AdvancedFilter action:=xlFilterCopy, copytorange:=run, unique:=True
Set run = Range(run.Offset(1, 0), run.End(xlDown))
For Each cun In run
rfull.AutoFilter field:=1, Criteria1:=cun
Set rfilt = ActiveSheet.AutoFilter.Range
rfilt.Copy Worksheets("sheet2").Range("a1").Offset(0, j)
j = j + 5
rfull.AutoFilter
Next cun

End Sub

Code:
Sub undo()
Worksheets("sheet2").Cells.Clear
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,729
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top