Assignment Operator

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Using an "IF" statment, I need to place the value of a calculation into a
non-related cell:

Cell A1 =IF(TRUE,(B1+B2 assigned to C3),0)

How do I do the "(B+B2 assigned to C2)" ?

Appreciate your help.
 
News,

You can't. Anything in a cell can only return a value to that cell. One
way is to put an IF in C2, and one in C3, that return the values you want
under the conditions you specify.
 
Hi
only possible wih VBA using an event procedure. If you like you can put
the following code in your worksheet module:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
application.enableevents = false
With Target
If .Value =TRUE Then
me.range("C3").value = me.range("B2").value + _
me.range("B1").value
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top