If MsgBox("This will sort all flights by time, Do you wish to continue?", vbYesNo + vbDefaultButton2, "Auto Sort") = vbNo Then Exit Sub
Range("A4:E21").Select
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Range("B4:B21") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveSheet.Sort
.SetRange Range("A4:E21")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.
.
.
.
With ActiveSheet.Sort
.SetRange Range("AK424:AO437")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
(I want to add a msg box stating that auto sort is complete)
Sub ClearUnlockedCells()
If MsgBox("Clear All Unprotected Cells On This Sheet?", vbYesNo + vbDefaultButton2, "Clear All Unprotected Cells") = vbNo Then Exit Sub
MsgBox ("Script Cancelled")
Dim WorkRange As Range
Dim Cell As Range
Set WorkRange = ActiveSheet.UsedRange
For Each Cell In WorkRange
If Cell.Locked = False Then Cell.Value = ""
Next Cell
End Sub
(I want a msg box saying Script Cancelled if user selects no and to exit script. The way it is now is that "script cancelled" shows but script runs anyway. I also would like a msg box saying script complete when it has run.)
I'm almost there but I guess I need a little help. As far as clear all unlocked cells, I think there is a better way to write that code. But I don't know how to do it. Can anyone help me please?
Bookmarks