اذهب الي المحتوي
أوفيسنا

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

  • أفضل إجابة
قام بنشر

السلام عليكم ورحمة الله

اجعل الكود هكذا

 Sub المجموع()
    Dim mr As Worksheet
    Dim LR, i, x, y, z, w, v As Long
    Dim WFS As Variant
    Application.ScreenUpdating = False
    Application.Calculation = xlManual
    Application.EnableEvents = False
    Set WFS = WorksheetFunction
    Set mr = Sheets("mark")
    LR = mr.Range("c" & Rows.Count).End(xlUp).Row
    For i = 9 To LR

       For x = 11 To 157 Step 10
       mr.Cells(i, x) = WFS.sum(mr.Cells(i, x - 2), mr.Cells(i, x - 1))
       Next x
       For y = 14 To 157 Step 10
       mr.Cells(i, y) = WFS.sum(mr.Cells(i, y - 2), mr.Cells(i, y - 1))
       Next y
       For z = 15 To 157 Step 10
       mr.Cells(i, z) = WFS.sum(mr.Cells(i, z - 6), mr.Cells(i, z - 3))
       Next z
       For w = 16 To 157 Step 10
       mr.Cells(i, w) = WFS.sum(mr.Cells(i, w - 6), mr.Cells(i, w - 3))
       Next w
       For v = 17 To 157 Step 10
       mr.Cells(i, v) = WFS.sum(mr.Cells(i, v - 2), mr.Cells(i, v - 1))
       Next v
       mr.Cells(i, 159) = WFS.sum(mr.Cells(i, 11) + mr.Cells(i, 21), mr.Cells(i, 31), mr.Cells(i, 41), _
       mr.Cells(i, 51), mr.Cells(i, 61), mr.Cells(i, 71), mr.Cells(i, 81), mr.Cells(i, 91), _
       mr.Cells(i, 101), mr.Cells(i, 111), mr.Cells(i, 121), mr.Cells(i, 131), mr.Cells(i, 141), _
       mr.Cells(i, 151))
       
    Next i
    Application.ScreenUpdating = True
    Application.Calculation = xlAutomatic
    Application.EnableEvents = True
End Sub

 

  • Like 2

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