اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

الردود الموصى بها

قام بنشر

السلام عليكم ورحمه الله وبركاته وبها نبدأ

1- قم بوضع هذا الكود في موديل جديد

2- قم بحفظ الملف بصيغه تقبل الماكرو وليكن XLSB

3- ثم شغل الكود

Sub Tarhil()
    Dim WS As Worksheet, SH As Worksheet, AR1, AR2, I As Long, J As Long, LR1 As Long, LR2 As Long
    Set WS = ThisWorkbook.Sheets("فواتير العملاء")
    Set SH = ThisWorkbook.Sheets("فاتورة المبيعات")
    AR1 = Array("C3", "C4", "E4", "C5", "C6", "E3", "H3", "J4", "J6")
    AR2 = Array("B", "C", "D", "E", "F", "G", "H", "I", "J")
    LR1 = SH.ListObjects("الجدول4").Range.Columns(2).Cells.Find("*", SearchDirection:=xlPrevious).Row
    LR2 = WS.ListObjects("الجدول2").Range.Columns(1).Cells.Find("*", SearchDirection:=xlPrevious).Row + 1
    
    For I = 8 To LR1
        For J = 1 To 9
            WS.Cells(LR2, J).Value = SH.Range(AR1(J - 1)).Value
        Next J
        For J = 10 To 18
            WS.Cells(LR2, J).Value = SH.Cells(I, AR2(J - 10))
        Next J
        LR2 = LR2 + 1
    Next I

End Sub

 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information