excel vba - protect sheet with conditions

  • Thread starter Thread starter chief
  • Start date Start date
C

chief

Is it possible to protect a sheet's cells against manual typing, but b
able to input data into the cells through userforms. Basically, I hav
an inventory set up with a main page which opens, which is used t
click on the appropriate button and navigate to a specified userform.
Once there, you enter the number in the textbox and click a (+) or (-
button to edit the inventory count. However, there are some peopl
which have to use the page for adding inventory, and others who ar
only supposed to view the page for quick reference. Is there a way t
protect the cells against people simply viewing the page, and allo
others to edit the cells through this (+/-) method?

Thank
 
Hi
in your userform you could add unprotect and protect statements
 
Hi

Yes. In an empty workbook, first run one and then the other:

Sub LockUp()
Sheets(1).Protect userinterfaceonly:=True
End Sub

Sub Add()
Sheets(1).Range("A1").Value = _
Sheets(1).Range("A1").Value + 1
End Sub

Unfortunately this kind of protection has to be done by macro code.

HTH. Best wishes Harald
 

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.

Ask a Question

Back
Top