لماذا لا تدمجهما تحت واحد ؟
هكذا مثلا ً
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRows As Integer, MyRange As Range, MyRange1 As Range
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("d1:d10000")) Is Nothing Then
VBA.Calendar = vbCalGreg
If IsEmpty(Target) Then
Target(1, 2).ClearContents
Else
With Target(1, 2)
.Value = Date
.EntireColumn.AutoFit
End With
End If
End If
On Error GoTo 1
With Range("kh_test_1")
MyRows = .Rows.Count - 1
Set MyRange = .Range(Cells(MyRows, 1), Cells(MyRows, 4))
If Not Intersect(Target.Cells(1, 1), MyRange.Cells) Is Nothing _
And Target.Value <> "" Then
MyRange.EntireRow.Insert
Set MyRange1 = .Range(Cells(MyRows, 1), Cells(MyRows, 4))
MyRange1.Value = MyRange.Value
MyRange.ClearContents
End If
End With
1
End Sub