Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default set second cell value based on formula in first cell?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set a cell value based on a formula in another cell? dingy101 Excel Discussion (Misc queries) 1 November 21st 05 08:51 AM
formula for named cell/range based on cell values alex Excel Programming 2 August 25th 05 02:50 PM
Enter a formula in a cell based on value in another cell Sandy Excel Programming 1 April 21st 05 07:06 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 07:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"