Disable cell editing once the data entered

2164 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

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
ARTICLESHIP 18 June 2026
Article Assistance

RB KESHRI & CO.

Mumbai

CA Inter

View Details
Company
01 June 2026
Audit, Taxation & Compliance Executive

R P S K & Associates

Nashik

CA Inter

View Details
Company
25 June 2026
Accounts & Taxation Executive

Dindukurthy & Associates

Hyderabad

MBA

View Details
Company
ARTICLESHIP 24 June 2026
CA Article Trainee

Rahul Dang & Associates

Pune

CA Inter

View Details
Company
ARTICLESHIP 04 June 2026
Article

Rakhecha & Co.

New Delhi

CA Inter

View Details
Company
12 June 2026
Accounts & Taxation Executive

Winshine Financial Services

Mumbai

CA Inter

View Details
Company
20 June 2026
Assistant Accounts Manager

Fintax Professionals

Gurgaon

CA Inter

View Details
Company
ARTICLESHIP 20 June 2026
Articleship

RB KESHRI & CO

Mumbai

B.Com

View Details