Excel-VBA : Range – Lock/Unlock Specific Cells

There are two different cases you might deal with,

  • Lock only few specific cells and rest of the cells in the work sheet are not locked(means you can edit them)
  • Lock the Enitre worksheet except few cells

Lock only few specific cells and rest of the cells in the work sheet are not locked

Steps:

  • Lock the selected cells
  • Provide the password

Note: If you wont provide the password then your cells will not be locked.

Read moreExcel-VBA : Range – Lock/Unlock Specific Cells

Excel-VBA : Change Passwords for all the WorkSheets in one shot

Objective : Suppose you have many worksheets in an excel and you want to change all the passwords in one shot rather doing it manually for every sheet, which might be very bad way to do specially when you have a power of doing it using VBA.

NOTE: you need a place to store your password, most of the timewe store it in our mind but computer doesn’t have mind, it has memory :), but the point is where, it could be a file, DB . Why not use your excel for that.

Store it in a separate sheet and make it very hidden in your code.

Read moreExcel-VBA : Change Passwords for all the WorkSheets in one shot

Password Protection to Your Macro Code

In earlier sessions we saw that how we can write code, generate code and customize it but at the same time it’s very essential to protect it. Excel provides an option to make our Code password protected.

In Next few steps we will see how to make our macro secure.

Step 1:

 In VB Editor, right click on the “VBAProject(Book1)” in Project window and select “VBA Project Properties..”

Excel-VBA-MACRO - Password Protection To Macro - 1
Excel-VBA-MACRO – Password Protection To Macro – 1

“Project Properties” window will be displayed.

Read morePassword Protection to Your Macro Code