Hello every one,
I have recorded a macro (gave a shortcut key "Ctrl+q") for custom Sort by column "F" and Sort order "From Smallest to Largest", I selected 6 columns and 5 rows ("F4:F10"), and stopped this Macro.
Sub Custom_Sort()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+q
'
ActiveWorkbook.Worksheets("print").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("print").Sort.SortFields.Add Key:=Range("F4:F10"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("print").Sort
.SetRange Range("A4:F10")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Now the problem is when I select different range and apply this macro but this is not working on my new selected range. I want this type of Sort to other selected range too, I have more than 2000 rows and want to select different range every time which is column "A" to "F" and different rows numbers(6 or 7 0r 8).
If anybody knows how to do that I'll be thankful for that.
Thanks.
Bookmarks