Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL - CELL PROTECTION AND FILTERING

Status
Not open for further replies.

susejdrol

Technical User
Apr 24, 2003
32
US
Team,

Is there any way to protect a column of data so that it cannot be overwritten and still allow that column to be used as autofilter criteria?

CP
 
Use a vba module, launched from a button or macro icon.


the sub as follows


Sub alt_filter()

Dim criteria_x As String

criteria_x = InputBox("Enter criteria for filtered view", "Criteria")

if criteria_x="" then exit sub

ActiveSheet.Unprotect
Selection.AutoFilter
Selection.AutoFilter Field:=7, Criteria1:=criteria_x ' replace the 7 with your column number
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top