View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rowan[_4_] Rowan[_4_] is offline
external usenet poster
 
Posts: 38
Default disabling a cell in excel

The simplest way would be to use worksheet protection. If it is the only cell
you want to protect then:

Sub prt()
With ActiveSheet
.Cells.Locked = False
With Range("B4")
.Value = "MyValue"
.Interior.ColorIndex = 15
.Locked = True
End With
.Protect Password:="mypassword"
End With
End Sub

Hope this helps
Rowan

" wrote:

How can I disable a cell using VBA in Excel. I want fill in a value in
the cell and then grey it out so that user can just see the value but
cannot edit it.

Your help is much appreciated.
regards