Hi,
I need help on my Exce2000 VBA to be fixed.
When I use Delete-Row command on the menu, I got an error message " run-time error 1004, application or object defined error". Debug points to the third line(2nd IF...) of my script below. There is no error if delete cells or whole columns. Below code works fine in Excel97/95.
********* My script **************;
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then
If Target.Text <> "" And IsEmpty(Target.Offset(0, 17).Value) Then
Application.EnableEvents = False
Target.Offset(0, 17).Value = "from:"
Application.EnableEvents = True
ElseIf Target.Text = "" Then
Application.EnableEvents = False
Target.Offset(0, 12).ClearContents 'Value = ""
Application.EnableEvents = True
End If
End If
End Sub
*************** end ***********;
Thanks,
Mike
I need help on my Exce2000 VBA to be fixed.
When I use Delete-Row command on the menu, I got an error message " run-time error 1004, application or object defined error". Debug points to the third line(2nd IF...) of my script below. There is no error if delete cells or whole columns. Below code works fine in Excel97/95.
********* My script **************;
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row <> 1 Then
If Target.Text <> "" And IsEmpty(Target.Offset(0, 17).Value) Then
Application.EnableEvents = False
Target.Offset(0, 17).Value = "from:"
Application.EnableEvents = True
ElseIf Target.Text = "" Then
Application.EnableEvents = False
Target.Offset(0, 12).ClearContents 'Value = ""
Application.EnableEvents = True
End If
End If
End Sub
*************** end ***********;
Thanks,
Mike