I created a spreadsheet with a search bar using VBA code. I then protected the sheet and the protection blocks the VBA code search function. Is there a way to add additional code to protect the sheet, but also still allow for filtering/search bar use? Below is the code that I used. I am also very new to VBA code and Excel in general. Your input is greatly appreciated.
Private Sub TextBox1_Change()
Application.ScreenUpdating = False
ActiveSheet.ListObjects(“AllDepartments”).Range.AutoFilter Field:=2, Criteria1:=”” & Range(“E1”) & ““, Operator:=xlOr, Criteria2:=”” & Range(“E1”).Value & “”
Application.ScreenUpdating = True
End Sub
Thanks!
Krista Zakis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.