bhtrong2808
Thành viên mới

- Tham gia
- 18/9/23
- Bài viết
- 13
- Được thích
- -2
tình hình là em có code như thế này ạ( ko phải em làm);
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("E:E")) Is Nothing Then
Application.EnableEvents = False
If Target.Offset(0, -2).Value = "" Then
Target.Offset(0, -2).Value = Now
End If
If Target.Offset(0, -1).Value = "" Then
Target.Offset(0, -1).Value = Now
End If
Application.EnableEvents = True
End If
End Sub
mỗi khi e chèn thêm 1 hàng thì code sẽ báo lỗi
Run-time error "1004"
Application-defined or object-defined error.
M.N GIÚP E VỚI Ạ
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("E:E")) Is Nothing Then
Application.EnableEvents = False
If Target.Offset(0, -2).Value = "" Then
Target.Offset(0, -2).Value = Now
End If
If Target.Offset(0, -1).Value = "" Then
Target.Offset(0, -1).Value = Now
End If
Application.EnableEvents = True
End If
End Sub
mỗi khi e chèn thêm 1 hàng thì code sẽ báo lỗi
Run-time error "1004"
Application-defined or object-defined error.
M.N GIÚP E VỚI Ạ