I have been using this below code.
It basically copies the value from cell H5 everytime it changes to the first empty cell in column N.
The problem is I need to copy H5 and I5 when H5 changes.
I have tried adding AND like this:
...Then sh.Range("N" & Range("N" & Rows.Count).End(xlUp).Row + 1).Value = sh.Range("H5") And sh.Range("O" & Range("O" & Rows.Count).End(xlUp).Row + 1).Value = sh.Range("I5")
this doesnt work.? Can anyone please enlighten me?
James
It basically copies the value from cell H5 everytime it changes to the first empty cell in column N.
The problem is I need to copy H5 and I5 when H5 changes.
I have tried adding AND like this:
...Then sh.Range("N" & Range("N" & Rows.Count).End(xlUp).Row + 1).Value = sh.Range("H5") And sh.Range("O" & Range("O" & Rows.Count).End(xlUp).Row + 1).Value = sh.Range("I5")
this doesnt work.? Can anyone please enlighten me?
Code:
Sub Update(ByVal sh As Object)
On Error GoTo exitsub
Application.EnableEvents = False
Sheets("Focus").Range("R1").Formula = "=$H$5"
If (sh.Range("N" & Range("N" & Rows.Count).End(xlUp).Row).Value <> sh.Range("H5") And sh.Range("H5").Value <> "") Then sh.Range("N" & Range("N" & Rows.Count).End(xlUp).Row + 1).Value = sh.Range("H5")
exitsub:
Application.EnableEvents = True
End Sub
James