Sort using array - help required

Lukums

Board Regular
Joined
Nov 23, 2015
Messages
195
Hello,

Currently I'm copying group data range by JOB ID from Sheet1 to Sheet2. So table for example please see below:
Grouping JOB IDs then sending them to Sheet2. This works fine as a group at a time when requested.
Once the data has been sent to Sheet2 it needs to sort by LENGTH + JOB IDs (ex JOB ID: 900)

The issue is:

900 is grouped and sent, then the 750 is grouped and sent straight after - I have no idea how to break this down and sort by length per JOB ID as an overall filter will destroy the JOB by JOB scenario.

I'm currently using to group my data.

With Sheets("Sheet1").UsedRange
.AutoFilter
.AutoFilter Field:=23, Criteria1:="C15015"
.AutoFilter Field:=25, Criteria1:="JOB SCHEDULED"
.Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy OB.Sheets("Sheet2").Cells(erow, 1)
.AutoFilter
End With


[TABLE="width: 500"]
<tbody>[TR]
[TD]JOB ID[/TD]
[TD]Cust Name[/TD]
[TD]Qty[/TD]
[TD]Length[/TD]
[TD]TYPE[/TD]
[TD]Status[/TD]
[/TR]
[TR]
[TD]900[/TD]
[TD]Luke[/TD]
[TD]5[/TD]
[TD]3700[/TD]
[TD]C15015[/TD]
[TD]Job Scheduled[/TD]
[/TR]
[TR]
[TD]900[/TD]
[TD]Luke[/TD]
[TD]8[/TD]
[TD]5200[/TD]
[TD]C15015[/TD]
[TD]Job Scheduled[/TD]
[/TR]
[TR]
[TD]750[/TD]
[TD]Mary[/TD]
[TD]4[/TD]
[TD]2400[/TD]
[TD]C15015[/TD]
[TD]Job Scheduled[/TD]
[/TR]
[TR]
[TD]750[/TD]
[TD]Mary[/TD]
[TD]4[/TD]
[TD]7200[/TD]
[TD]C15015[/TD]
[TD]Job Scheduled[/TD]
[/TR]
[TR]
[TD]400[/TD]
[TD]John[/TD]
[TD]2[/TD]
[TD]5000[/TD]
[TD]C15015[/TD]
[TD]Job Scheduled[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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