تم التعديل
Sub Inqwayry()
' 26/08/2018 بواسطة Zmn
' استخراج بيانات برقم الفاتورة
Dim Q1, Q2, FR, TR
Range("A11:L111").ClearContents
Q1 = Range("C6").Value 'رقم الفاتور
TR = 11
For Q2 = 1 To Sheets.Count
If Sheets(Q2).Name = ActiveSheet.Name Then GoTo 3
With Sheets(Q2)
For FR = 3 To 3333
If .Cells(FR, 14) = Q1 Then
Cells(TR, 1) = .Cells(FR, 3) & .Cells(FR, 4)
Cells(TR, 2) = .Cells(FR, 5)
Cells(TR, 3) = .Cells(FR, 6)
Cells(TR, 4) = .Cells(FR, 7)
Cells(TR, 5) = Application.Sum(.Cells(FR, 8), .Cells(FR, 20))
Cells(TR, 6) = Application.Sum(.Cells(FR, 9), .Cells(FR, 21))
Cells(TR, 7) = Application.Sum(.Cells(FR, 10), .Cells(FR, 22))
Cells(TR, 8) = Application.Sum(.Cells(FR, 11), .Cells(FR, 23))
Cells(TR, 9) = Application.Sum(.Cells(FR, 12), .Cells(FR, 24))
Cells(TR, 10) = Application.Sum(.Cells(FR, 13), .Cells(FR, 25))
Cells(TR, 11) = .Cells(FR, 27)
Cells(TR, 12) = .Cells(FR, 26)
Cells(TR, 13) = Sheets(Q2).Name
TR = TR + 1
End If
Next FR
End With
3 Next Q2
End Sub
Testعمرضاحي.xls