I’m building a Workbook with 3 sheets in it: “Current”, “Lookup Lists” and “Full History”.
“Current” has a list of Aircraft Numbers in A, Serial Number of fitted widget in B, and various other info in C to N.
The lists of Tail Numbers and Serial Numbers come from “Lookup Lists”, and use Derk’s Most Excellent method for ensuring that once an aircraft is in the list, you can’t add it again. Likewise, once you fit a Widget to any aircraft, it comes off the list so you can’t fit it to another aircraft.
What I want to do is update “Full History” any time a change is made to any of the cells in “Current”, ie if I change the Widget fitted to an aircraft, a new line is added to the list in “Full History”
Pseudo code for the WorksheetChange() event in “Current”:
Select cells A to N of the row that’s just been changed
Copy the selection
Select the next blank row in “Full History”
Paste the values
End Sub
What I’ve got so far is this:
Private Sub Worksheet_Change(ByVal Target As Range)
Range("A4:N4").Select
Selection.Copy
Sheets("Full History").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub
If I run this from a button, it works just fine, but in the WorksheetChange() event I get a “Select method of Range class failed” error. What am I doing wrong?
Thanks in advance,
Chris