Code to disable a cell in excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok i've looked all over but i am new to excel and don't know how to change
the advice people have given to others to suit my own purposes.

So my question..

I am making a spreadsheet form that people are going to be filling out using
both text and numbers.

Most of the sheet will be unlock, but i want certain cells to be visible
(but greyed out) when another cell has a certain value.

for example this code would be in E5 -- =If(D5=15,2,"grey out E5")

IE if D5=15 then the value in E5 would be 2, otherwise E5 would be greyed
out and unaccesable.

Is this even possible? thanks in advance.
Athens
 
you could use conditional formatting to color the cell. then, on the sheet
where these cells are, use something like the following as sub worksheet
selection change code:

If Range("E5").Value = "grey out E5" Then
Range("E5").Locked = True
Else
Range("E5").Locked = False
End If

Hope this helps!
-Chad
 
Back
Top