Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try some thing like:
sub Test1() Activesheet.Unprotect Password:="ABC" With Range("A2") If Range("D4")<"P.B.A." then .Value = "" .Locked = True Else .Locked = False End if End With Activesheet.Protect Password:="ABC" End Sub "dingy101" wrote: I have a cell (A2) that I would like to be forced to .0000 or preferably a blank display if another cell (D4) does not contain the string P.B.A.. The cell (A2) that I am trying to force to .0000 (or blank) is a cell that if the cell (D4) does display P.B.A. then the user can input numeric data into it. I would Also like to lock cell (A2) to restrict input if cell (D4) does not display P.B.A. Cell (A2) could contain the formula if this would permit user input into it with out affecting the formula. Is there a way to lock or hide the formula? The data in cell (D4) is selected from a list via data validation. (this works OK.) Gary The data in cell (A2) is used by another cell with an IF statement (this works OK.) " wrote: (G8,0) is not a valid excel formula, but it is a valid string. Worksheet functions can only return values. The returned value is displayed in the cell containing the formula. Formulas can not direcly effect the value of other cells but they can be refered to by those cells. In order to give an answer you can use you really need to explain the problem some more. /m http://www.aminaahamed.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I set a cell value based on a formula in another cell? | Excel Discussion (Misc queries) | |||
formula for named cell/range based on cell values | Excel Programming | |||
Enter a formula in a cell based on value in another cell | Excel Programming | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) | |||
Cell Formula reference to cell Based On third Cell Content | Excel Discussion (Misc queries) |