Hi, i have code :
It is working to select taget cell. But when the cell be edited, error message appears i.e : "Object variable or with block variable not set."
How to solve this problem ??
Thanks a lot.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim DataRange As Range
Set DataRange = Range("D2:D50")
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, DataRange).Value = "Daftar" Then
Target.Offset(0, 1).Select
End If
If Intersect(Target, Range("D2:D50")).Value = "NA" Then
Target.Offset(0, 2).Select
End If
end Sub
It is working to select taget cell. But when the cell be edited, error message appears i.e : "Object variable or with block variable not set."
How to solve this problem ??
Thanks a lot.