Assuming that Cell A2 has the formula =A1 and A1 is the cell being remotely updated,
maybe:
Code:Private Sub Worksheet_Calculate() Cells(Rows.Count,"B").end(xlUp).Offset(1,0).Value = Range("A1").value End Sub
EDIT:
Note, I may be too cautious here. I don't trust programmatic changes because I don't have experience with them, so having some other cell depend on the programmatically changed cell is another triggering event.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
Application.EnableEvents = False
Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
Application.EnableEvents = True
End If
End Sub
Maybe the data coming into A1 will trigger a change event. Try
Code:Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address(False, False) = "A1" Then Application.EnableEvents = False Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value Application.EnableEvents = True End If End Sub
Thanks 10000000. It works like a charm!!!!!
JC
Try Alexander's suggestion:
In any spare cell enter the formula
=A1
then use the code
Code:Private Sub Worksheet_Calculate() Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).Value = Range("A1").Value End Sub
Private Sub Worksheet_Calculate()
If Cells(Rows.Count, "B").End(xlUp).Value <> Range("A1").Value Then
Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).Value = Range("A1").Value
End If
End Sub
Almost there.... if filling column B but repeating the data in A1 without it changing. Remember that I need to get each data change into column B
Could u help?? Thanks
JC
If you mean that it is adding values to column B when A1 is not changing try
Code:Private Sub Worksheet_Calculate() If Cells(Rows.Count, "B").End(xlUp).Value <> Range("A1").Value Then Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).Value = Range("A1").Value End If End Sub