Hi
It looks like you are sorting using column F.
This will never do what you want. Because the x in 2x10 makes your data alpha numeric rather than numeric. in which case 2x10 is smaller than 2x4.
Split column F into two columns then sort by the number before x and then by number after x.
Try inserting this routine into your code.
Sub Macro1()
Range("H6:H17").FormulaR1C1 = "=LEFT(RC[-2],SEARCH(""x"",RC[-2])-1)"
Range("I6:I17").FormulaR1C1 = "=RIGHT(RC[-3],LEN(RC[-3])-SEARCH(""x"",RC[-3]))"
Range("A6:I17").Select
Range("I17").Activate
ActiveWorkbook.Worksheets("Database").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Database").Sort.SortFields.Add Key:=Range("H6:H17" _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
ActiveWorkbook.Worksheets("Database").Sort.SortFields.Add Key:=Range("I6:I17" _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
ActiveWorkbook.Worksheets("Database").Sort.SortFields.Add Key:=Range("C6:C17" _
), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Database").Sort
.SetRange Range("A6:I17")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks