I have a sheet with data C3:N127. It is a named range: masterlist. Above the column headers, I have placed 10 arrows and have assigned sort macros to them. Such as:
The cells in the data sheet are locked, as the data is retrieved from other places, and the sheet is protected. Because the cells are locked, sorting is not allowed. I need help with code to unprotect the sheet, then call up a sort macro, then re-protect the sheet. Or, I could just add the on/off protection code to each of the ten sort macros. Suggestions certainly welcome.
Thanks,
Ricky
Code:
Sub MacroJobName()
'
' 1/24/2015 by Ricky's 7
'
Range("masterlist").Sort Key1:=Range("i3"), Order1:=xlAscending, Key2:=Range("C3") _
, Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
xlSortNormal
End Sub
The cells in the data sheet are locked, as the data is retrieved from other places, and the sheet is protected. Because the cells are locked, sorting is not allowed. I need help with code to unprotect the sheet, then call up a sort macro, then re-protect the sheet. Or, I could just add the on/off protection code to each of the ten sort macros. Suggestions certainly welcome.
Thanks,
Ricky