Hi, I have the following code, but I keep getting 'error 91: Object variable or With block variable not set'.
Does somebody have a solution to this?
Thank you very much!
The code is moving the value of A1 and B1 to A2 and B2, the value of A2 and B2 to A3 and B3, ... every time A1 changes. The value of A1 isn't entered manualy but comes over an OPC server.
Does somebody have a solution to this?
Thank you very much!
The code is moving the value of A1 and B1 to A2 and B2, the value of A2 and B2 to A3 and B3, ... every time A1 changes. The value of A1 isn't entered manualy but comes over an OPC server.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Me.Unprotect "koen"
Dim c As Range
c = Range("A" & Rows.Count).End(xlUp).Row
Range("A" & c + 1).Value = Range("A1").Value
Range("B" & c + 1).Value = Range("B1").Value
Me.Protect "koen"
End Sub