NYRANGERS423
New Member
- Joined
- Mar 17, 2016
- Messages
- 27
So I get this when I use my spreadsheet, Rint-Time error '1004'; Application-definded or object-defined error.
Here is the code I have,
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Columns("A")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 2) = "" Then
Target.Offset(, 2) = Date
Target.Offset(, 6) = Time
**Target.Offset(, 8) = Worksheets("Name List").Range("E2").Value
End If
ElseIf Not Intersect(Target, Columns("B")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 6) = "" And Target.Offset(, 1) <> " " Then
Target.Offset(, 6) = Time
Target.Offset(, 9) = Worksheets("Name List").Range("E2").Value
End If
End If
End If
End Sub
**The Star indicates where the error occurs.
What I don't get is I have the same line of code a little farther down "Target.Offset(, 9) = Worksheets("Name List").Range("E2").Value" and it works just fine. Is excel not able to find the cell?
Here is the code I have,
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Columns("A")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 2) = "" Then
Target.Offset(, 2) = Date
Target.Offset(, 6) = Time
**Target.Offset(, 8) = Worksheets("Name List").Range("E2").Value
End If
ElseIf Not Intersect(Target, Columns("B")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 6) = "" And Target.Offset(, 1) <> " " Then
Target.Offset(, 6) = Time
Target.Offset(, 9) = Worksheets("Name List").Range("E2").Value
End If
End If
End If
End Sub
**The Star indicates where the error occurs.
What I don't get is I have the same line of code a little farther down "Target.Offset(, 9) = Worksheets("Name List").Range("E2").Value" and it works just fine. Is excel not able to find the cell?