Hello,
I am trying to make a worksheet for people that aren't very familiar with Excel. I want to make a sort button that will sort only the areas that have been highlighted. There are multiple places where this worksheet will be sorted. I know that somehow I will have to change the range in my macro.
Range("A2:N34").Select
ActiveWorkbook.Worksheets("Material Sort").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Material Sort").Sort.SortFields.Add Key:=Range( _
"E2:E34"), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
"BF.SM.01,BF.SM.02,BF.SM.03,BF.SM.04,BF.SM.05,BF.SM.06", DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Material Sort").Sort
.SetRange Range("A2:N34")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("H24").Select
End Sub
This is the macro now for an area I selected. Which range do I change to make it only highlighted areas.
Thanks
Bookmarks