banner_ad

Disable cell editing once the data entered

2145 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  

Company
22 May 2026
Audit assistant

Displayandbeyond

Mumbai

CA

View Details
Company
08 May 2026
CHARTERED ACCOUNTANT

SHAH LADHA AND ASSOCIATE

Ahmedabad

CA

View Details
Company
22 May 2026
Sr. Financial Analyst - Consolidation

Search Synergy

Mumbai

CA

View Details
Company
19 May 2026
Article, CA & Paid Assistant Positions

Aggarwal Sarawagi and Co

New Delhi

CA

View Details
Company
08 May 2026
Paid Assistants

Quick Taxperts Private Limited

Bengaluru

Graduate (Any)

View Details
Company
11 May 2026
CA Dropout

Patron Accounting LLP

Pune

CA Inter

View Details
Company
03 May 2026
Senior Chartered Accountant

Nirmal Jain & Co

New Delhi

CA

View Details
Company
14 May 2026
Financial Analyst - Remote Finance Expert

HiringBridge

Ahmedabad

CA

View Details