Solved i have a worksheet once the empty cell is with value lock it

April 30, 2012 at 08:22:58
Specs: Windows xp, 2gb
cell should not be edited after its first entry, only that cell should be locked i.e., how many cells are with value only those many should be locked not the other cells in excel if it is macro how to also you pl let me know

pl help me out fast

See More: i have a worksheet once the empty cell is with value lock it

Report •

April 30, 2012 at 10:22:35
✔ Best Answer
The first thing you need to do is to Unlock all of the cells where you want to allow users to enter data.

Then you should protect the sheet with a password. I'll use "secret" in this example.

Next, right click on the sheet tab for the sheet in which you want this happen and choose View Code.

Paste this code into the pane that opens:

Private Sub Worksheet_Change(ByVal Target As Range)
 ActiveSheet.Unprotect Password:="secret"
  Target.Locked = True
 ActiveSheet.Protect Password:="secret"
End Sub

Finally, you should password protect the macro from viewing so that no one can see the password. Note: The macro protection won't take effect until you save and close the workbook.

Keep in mind that all users will need to have their Excel appliocation set to allow macros to run or none of this will work. Before you ask, No, you can not enable macros on another person's machine via a macro. Think of the security risks if that were allowed.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question