View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
bahri bahri is offline
external usenet poster
 
Posts: 8
Default Impossible with formula BUT

Hi
I have tried a few things out.
Works great on one instance that is applied to one row and combining for two
rows as below for rows 1 and 2:
==================
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "A1" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("B1").Value = Range("B1").Value + .Value
Application.EnableEvents = True
End If
End If
End With

With Target
If .Address(False, False) = "A2" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("B2").Value = Range("B2").Value + .Value
Application.EnableEvents = True
End If
End If
End With
End Sub
=====================
However is there a way to apply the macro for several rows without producing
such long code?
Thanks all

Regards
bahri