A question about populating a cell from another cell location

  • Thread starter Thread starter Don Macek
  • Start date Start date
D

Don Macek

I'm not sure if this is an easy question or not:
I have a spreadsheet with cells that have an IF function
in a formula. When the IF function criteria is not met (a
False answer) I want the cell to be blank, so others can
type in information into them.

The problem is that people type over the IF function
formula when the cell are blank.

So I move the formula off to other cells, but I still need
to populate the original cells when the IF function
criteria is met (a TRUE statement)

How do I tell Excel to do this state?:
IF criteria is TRUE, THEN populate the answer in this cell
reference.

I'm not good with VBA, is there a simple formula I can use?

-Don
 
Don,

There is no formula that you can use: you can use the worksheet
calculate event to check your conditional value and proceed from
there: The example below will put "It's True" into cell B3 when cell
A3 is 3, otherwise B3 will be blank.

Rightclick on the sheet tab and select "view code", then paste the
code below into the window that appears.

HTH,
Bernie


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Range("A3").Value = 3 Then
Range("B3").Value = "It's True"
Else
Range("B3").ClearContents
End If
Application.EnableEvents = True

End Sub
 
Back
Top