Single time data entry in cell

Chiragpatel

New Member
Joined
Aug 23, 2011
Messages
6
Hello everyone, I want to know that in Ms-excel, how to enable cell to make a single time data entry. That is once you enter data in a cell, afterwards you cannot change without password.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hello Datsmart, I want to know that how only one time data is entered in cell and after that data cannot be changed until password of protection is not given. I received tips but it works only with one cell. I want to make one time data entry in multiple cells i.e ranges.
 
Upvote 0
What code did you try?

The code in the suggested post "locks" the cell after it is changed. After that you can not even select it again.
Post the code you try and explain how it is not doing what you want and I will see if I can help with a solution.
 
Upvote 0
Hello Datsmart,
I tried the following code. It protects the whole sheet after entering the data in one cell. I want in multiple or range of cells.

Private Sub Worksheet_Change(ByVal Target As Range)

'unprotect the sheet
ActiveSheet.Unprotect

'change the cell(s) that were changed to 'Locked'
Target.Locked = True

'protect the sheet
ActiveSheet.Protect

End Sub
 
Upvote 0
Did you Un-Lock all worksheet cells first like Kristy mentioned in the thread I posted above?

Here is another older thread on the subject.
http://www.mrexcel.com/forum/showthread.php?t=213186
It allows you to input Ranges you want to protect.

If you do not want the user to be able to select the previously edited cell, add the following line of code after you protect the sheet.
Code:
    ActiveSheet.EnableSelection = xlUnlockedCells
 
Upvote 0
Hello Datsmart,
Thank your for your suggestions. But I am very confused. I applied both code which you sent me earlier to refer with. One thing I want to tell you is that I have not much knowledge of Visual basic. I just know to open with Alt+F11, paste the codes and save with Alt+Q. That's it. If you explain me the whole method step by step I would be very much thankful to you.
For your information My quote is once if I enter data in a cell, second time no one can change that data without password.

Thanks for help me...
 
Upvote 0

Forum statistics

Threads
1,224,562
Messages
6,179,526
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top