Forum Discussion

Trismos's avatar
Trismos
Copper Contributor
Dec 27, 2019

Using VBA to clear all unlocked cells in a work book

Hello

 

I have an inspection report built over several sheets where the questions are in locked cells and the answer boxes (drop down menus) are in unlocked cells. I'd like to have a Reset or Clear button to clear all unlocked answers when starting a new inspection. Example with VBA doing a different task already present. (Needs to be there.) Please advise if having the sheet protected would matter.

Thanks in advance, 

Trismos

1 Reply

  • Trismos's avatar
    Trismos
    Copper Contributor

    I've added the code in a separate module and a button to run it on Sheet 1 (CH 13 BPA). It clears the data in the appropriate cells in this sheet but not the others. 2 things - how does the code know I'm referencing that sheet (other than I placed the button there), and how do I get it to apply to all sheets?

Resources