Disable cell editing once the data entered

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

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
Featured ARTICLESHIP 17 November 2026
Associate/ Article Trainee

M/s. A V C & Co.

New Delhi

CA Inter

View Details
Company
ARTICLESHIP 29 November 2026
Accounts Executive

Ajay S. Yadav & Associates

Mumbai

Graduate (Any)

View Details
Company
10 November 2026
Direct Tax Manager

CAAQ CONSULTANCY PVT LTD

New Delhi

CA Final

View Details
Company
16 November 2026
Indirect Tax Associate

Sekhri Kanodia & Associates

Mumbai

B.Com

View Details
Company
20 November 2026
Senior Accountant

Compass Tex India Pvt Ltd

Coimbatore

CA Inter

View Details
Company
30 November 2026
accountant

A K PRAJAPATI AND ASSOCIATES

Vadodara

CA Final

View Details
Company
25 November 2026
Account Executive

Aarti HR Services

Navi Mumbai

B.Com

View Details
Company
25 November 2026
Finance Head

ILJIN ELECTRONICS

Bengaluru

CA

View Details