Disable cell editing once the data entered

2065 views 3 replies

Respected Members,

I am developing a custom software in Microsoft Excel in 97-2003 Format. This program will determine the total and maximum running vehicle through graph. The program is completed but the thing is that, I wanted to disable a particular cell as soon as the data is entered in cell and pressed enter, means to stop the users to edit the value as soon as they press enter. So, can anyone just help me out, to solve out this querry? Any help, ideas and suggestions will be appreciated. Hope the best from your side.

Thanks in advance,

Regards,

Yuvraj Kumar, Asst. Manager (Information Technology)

Replies (3)

Try this Macro in the sheet where data is entered

 

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo MyError
 
    Selection.Locked = True
    Selection.FormulaHidden = False
       ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True 
  Exit Sub
MyError:
  
  MsgBox ("i found a culprit") ' in case somebody tries to delete the range using control+"-" then msgbox gets poppedup
  End
End Sub
        

 

Dear,

First of all thank you very much for the reply. I had attached the said file, please download it and in the column "I" which is "End, Odometer End", i want to apply restriction for the user as soon as he enters the data, and presses enter. He should not be able to delete/edit the data once entered. Waiting for a good resolution.

Thank you in advance!

 hey here is the modified file


CCI Pro

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register