asac,
Ok, since the Change event does not run when a formula changes the cell, you will have to get rid of the Change event code and use the Calculate event. There is 1 drawback but hopefully it will not interfere. You will have to pick 1 column in your worksheet that will never be used. Doesn't matter which one.. could be column 1 or the last column in the entire sheet (I don't know what that is.. lol) but that column will be used to store the last value you entered so the code will know whether to add a new value to the row or not. You can hide the column if you want or whatever. You will never need to see it, but it will have to be there. There is no way to make the Change event run when the cell is changed by a formula.
Here is the code. Currently it uses the cell 1 to the left of AG but you can change that to any column you want like I said. There is a comment on that line. I hope you are able to use this. It will have to be changed to fit your needs, but it works perfectly for the exact question you asked.
Private Sub Worksheet_Calculate()
Dim r As Range
Dim r2 As Range
Set r = Range("AG" & ActiveCell.Row)
If r.Offset(0, -1).Value <> r.Value Then
Set r2 = r.Offset(0, 2)
r.Offset(0, -1).Value = r.Value 'Change this column offset value (-1) to any column you want
Do Until r2.Value = ""
Set r2 = r2.Offset(0, 1)
Loop
r2.Value = r.Value
End If
Set r = r.Offset(1, 0)
End Sub
Bookmarks