S
Steven
How can I add a macro & button that can be clicked on a protected sheet?
this is the macro I would like assigned to a button, also how to keep the
button visible when > Options > View > Objects > Hide all, is selected?
Sub SortTotals()
ActiveSheet.Unprotect
ActiveWorkbook.DisplayDrawingObjects = xlPlaceholders
Columns("A:C").Select
Range("C1").Activate
Selection.EntireColumn.Hidden = False
Selection.AutoFilter Field:=1, Criteria1:="Show"
Columns("A:B").Select
Range("B1").Activate
Selection.EntireColumn.Hidden = True
ActiveWorkbook.DisplayDrawingObjects = xlHide
ActiveWindow.SmallScroll Down:=-9
Range("C7:K74").Select
Selection.Sort Key1:=Range("C7"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End Sub
Many thanks,
Steve
this is the macro I would like assigned to a button, also how to keep the
button visible when > Options > View > Objects > Hide all, is selected?
Sub SortTotals()
ActiveSheet.Unprotect
ActiveWorkbook.DisplayDrawingObjects = xlPlaceholders
Columns("A:C").Select
Range("C1").Activate
Selection.EntireColumn.Hidden = False
Selection.AutoFilter Field:=1, Criteria1:="Show"
Columns("A:B").Select
Range("B1").Activate
Selection.EntireColumn.Hidden = True
ActiveWorkbook.DisplayDrawingObjects = xlHide
ActiveWindow.SmallScroll Down:=-9
Range("C7:K74").Select
Selection.Sort Key1:=Range("C7"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End Sub
Many thanks,
Steve