ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling a cell for editing or deleting (https://www.excelbanter.com/excel-programming/277939-re-disabling-cell-editing-deleting.html)

Tom Ogilvy

Disabling a cell for editing or deleting
 
ActiveSheet.Unprotect Password = "ABCD"
Range("B9").Locked = True
Range("B9").Interior.ColorIndex = 15
ActiveSheet.Protect Password = "ABCD"


You can do multiple cells at once

Range("B9:B20,C15,J31:J35").Locked = True
Range("B9:B20,C15,J31:J35").Interior.ColorIndex = 15


--
Regards,
Tom Ogilvy


Consuelo wrote in message
...
Hello,
I am getting familiar with excel vba and I would like to
know how can I programmatically disable/gray out a cell
once I have entered data in it?

I have tried using lock and deactivate and I could not
get it to work.

Thanks.
Consuelo :-)





All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com