I have written a VBA module to Sort Filtered Unique data in a specific location. The problem is, I do the same code four times.
Is there a more efficient way to use the same sorting method without having to do the same code four times?
I have supplied a copy of my code for all to review:
'Sort Unique Values: TestGrp
Range("SgDV_TestGrp").Sort Key1:=Range("SgSort_TestGrp"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Sort Unique Values: Product
Range("SgDV_Product").Sort Key1:=Range("SgSort_Product"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Sort Unique Values: Machine
Range("SgDV_Machine").Sort Key1:=Range("SgSort_Machine"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'Sort Unique Values: SampleType
Range("SgDV_SampleType").Sort Key1:=Range("SgSort_SampleType"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Bookmarks