Microsoft Excel Question:

Download Job Interview Questions and Answers PDF

Some of the functions that we want our macros to accomplish are not possible without first unprotecting the worksheet/workbook with the password?

MS Excel Interview Question
MS Excel Interview Question

Answer:

Worksheets("MySheet").Unprotect password:="drowssap"
'your code here
Worksheets("MySheet").Protect password:="drowssap"

Be sure to protect your macro code to hide the sheet password.

Download MS Excel Interview Questions And Answers PDF

Previous QuestionNext Question
How can I unprotect a VBA project using code?Is it possible to call a macro from the condition true or false side of a worksheet formula? i.e. If(A2="OK",Run macro1,run macro2)?