The code works this way on my sheet.
Enter a value in M5 hit enter.
If cell A8 on History Sheet is empty, then that value goes in A8.
Enter another value in M5 and hit enter, that value goes the cell A9.
Repeat and cells A10 then A11, A12 etc. each get the next value in turn from cell M5.
Is that what you are doing?
You cannot copy
Sub Worksheet_Change(ByVal Target As Range) for cell N5. You can only have one
Worksheet_Change code in the sheet module.
We would have to modify the code within the sub to do the N5 caper.
Try this but delete the other code first.
Howard
Code:
Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("$M$5,$N$5")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
If Target.Address = "$M$5" Then
If Sheets("History Sheet").Range("A8") = "" Then
Target.Copy Sheets("History Sheet").Range("A8")
Else
Target.Copy Sheets("History Sheet").Range("A" & Rows.Count).End(xlUp)(2)
End If
ElseIf Target.Address = "$N$5" Then
If Sheets("History Sheet").Range("B8") = "" Then
Target.Copy Sheets("History Sheet").Range("B8")
Else
Target.Copy Sheets("History Sheet").Range("B" & Rows.Count).End(xlUp)(2)
End If
End If
End Sub