Quote:
Originally Posted by nstygma
yep
Code:
Sub SORT()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+n
'
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
' Range("A3:F34").Select
' If ActiveSheet.ProtectContents Then
' ActiveSheet.Unprotect
' End If
ws.SORT.SortFields.Clear
ws.SORT.SortFields.Add Key:=Range("A3:A34") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ws.SORT
.SetRange Range("A3:F34")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ws.Protect
Next
End Sub
|
Great! Thank you very much.
