Dear All,
Greetings!!!
I am a new member of this forum. The interest and zeal to develop the skills in excel brought me to this page.
I am beginner and quick learner.
I am prepared a simple macro in excel sheet to do the Auto Sorting function.
I want to add a confirmation message that should prompt after clicking the macro button.
Below is the code for the macro.
Code
- Sub AutoSorting()
- '
- ' AutoSorting Macro
- '
- ' Keyboard Shortcut: Ctrl+Shift+M
- '
- Range("B11").Select
- ActiveWindow.SmallScroll Down:=-27
- Range(Selection, Selection.End(xlDown)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Range(Selection, Selection.End(xlToRight)).Select
- Range("B10").Select
- Range(Selection, Selection.End(xlDown)).Select
- Range(Selection, Selection.End(xlDown)).Select
- Range(Selection, Selection.End(xlToRight)).Select
- ActiveWorkbook.Worksheets("Col").Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("Col").Sort.SortFields.Add Key:=Range("B11:B5010") _
- , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
- With ActiveWorkbook.Worksheets("Col").Sort
- .SetRange Range("B10:J5010")
- .Header = xlYes
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- End Sub
Thanks in advance.