You can protect the worksheet programmatically as the workbook opens:
Private Sub Workbook_Open()
With Worksheets("Sheet4")
.EnablePivotTable = True
.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub
This will prevent users from typing in the worksheet cells, but they
would be able to change the field names by right-clicking on a field
button and choosing Field Settings.
Thanks,
it work very well, but how I can enable the refresh function too
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.