السلام عليكم
أخي الكريم
جرب الكود التالي
Sub Macro1()
'
' Macro1 Macro
'
Dim xs1, xs2 As Range
Sheets("البيانات").Select
x_type = [b1]
xs1 = Range("C13:c15")
Range([d4], [d12]).Copy
Sheets("a").Select
[C10000].End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
Cells(ActiveCell.Row, 2).Value = x_type
i = -1
For Each ss In xs1
i = i + 1
Cells(ActiveCell.Row, 12 + i).Value = ss
Next
If x_type = "صادر" Then
For Z = 3 To 14
Cells(ActiveCell.Row, Z).Value = -Cells(ActiveCell.Row, Z).Value
Next Z
End If
Sheets("البيانات").Range("C4:c12").ClearContents
Cells(ActiveCell.Row + 1, 2).Select
End Sub