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!

How to let user filter spreadsht but require userform to make changes?

Status
Not open for further replies.

Chats

Technical User
Mar 12, 2002
88
GB
Hi,

I have a spreadsheet in Excel 2000. I want to allow the users to access the spreadsheet to use autofilter & view records, but if the user tried to make any changes to the data, they are blocked from doing so and told to use the userform instead. This is to control the quality of data input as the userform has validation etc.

My original plan was simply to lock & protect the spreadsheet in normal excel view, then use VBA to unlock the spreadsheet when the userform is opened, locking it again on exit.

This doesn't work for me because when the spreadsheet is protected, autofilter does not work.

Does anybody have any suggestions?

Thanks

Ade
 
I'm answering my own posts now, is that the same as talking to yourself?

I managed to track down a previous post from searching, and building on it came up with this

Selection.autofilter
ActiveSheet.Protect Contents:=True, userInterfaceOnly:=True
ActiveSheet.EnableAutoFilter = True

This protects the worksheet but allows autofilter to work.

Cheers

Ade
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top