Code to disable a cell in excel

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
 
G

Guest

You certainly can accomplish task. Look in the help files for 'Conditional
Formatting'
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top