ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Code to disable a cell in excel (https://www.excelbanter.com/excel-discussion-misc-queries/131448-code-disable-cell-excel.html)

Athens

Code to disable a cell in excel
 
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

Wood Grafing

Code to disable a cell in excel
 
You certainly can accomplish task. Look in the help files for 'Conditional
Formatting'

"Athens" wrote:

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


chad

Code to disable a cell in excel
 
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


"Athens" wrote:

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



All times are GMT +1. The time now is 08:05 AM.

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