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

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

قام بنشر

استاذنا القدير لسبب اجهله لم اوفق في ارسال المرفق ضمن المشاركة السابقه ما اضطرني الى انشاء مشاركة جديده ارفقت فيها الملف الاول متضمنا كودكم الرائع وتأشير الخليتين المطلوب تضمين معادلتيهما ضمن الكود مع الامتنان

معادلات الى اكواد2.zip

قام بنشر

وعليكم السلام

المعادلتين خارجة عن نطاق الجدول

ممكن تسجل كود بالمعادلتين

وتضمنها مع الحدث

او تربطها بزر

هذا مثال: لاحدى المعادلتين


Sub ماكرو1()

    Range("I12").FormulaR1C1 = _

        "=SUMPRODUCT((الوكلاء!R5C5:R2002C5<=R8C5)*(الوكلاء!R5C4:R2002C4=R[-2]C[-4])*(الوكلاء!R5C8:R2002C8))"

    Range("I12").Value = Range("I12").Value

End Sub

قام بنشر

استاذنا القدير مع شكري وتقديري لا ارغب بزر للمعادلتين ارجو المساعده ( ان امكن ) في دمج المعادلتين بالكود لتعمل سويا مع الامتنان


Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next

Dim R As Integer

If Not Intersect(Target.Cells(1, 1), Union(Range("D18:D39"), Range("F18:F39"), Range("O18:O39"))) Is Nothing Then

        R = Target.Row

        If Cells(R, "D").Value <> "" Then

                Cells(R, "C").Value = R - 17

                Cells(R, "G").Value = Val(IIf(Cells(R, "O") <> "", Cells(R, "O"), Cells(R, "N")))

                Cells(R, "H").Value = Val(Cells(R, "F")) * Val(Cells(R, "G"))

                Cells(R, "N").Value = WorksheetFunction.VLookup(Cells(R, "D"), [prices], 3, 0)

                Cells(R, "P").Value = WorksheetFunction.VLookup(Cells(R, "D"), [prices], 4, 0)

                Cells(R, "Q").Value = (Val(Cells(R, "G")) - Val(Cells(R, "P"))) * Val(Cells(R, "F"))

        Else

                Union(Cells(R, "C"), Cells(R, "H"), Cells(R, "N"), Cells(R, "P"), Cells(R, "Q")).ClearContents

        End If

        kh_Formula2

End If

On Error GoTo 0

End Sub


Private Sub kh_Formula2()

    Range("I10").FormulaR1C1 = "=IF(RC[-4]="""","""",VLOOKUP(RC[-4],address,3,0))"

    Range("I10").Value = Range("I10").Value

    Range("I12").FormulaR1C1 = _

        "=SUMPRODUCT((الوكلاء!R5C5:R2002C5<=R8C5)*(الوكلاء!R5C4:R2002C4=R[-2]C[-4])*(الوكلاء!R5C8:R2002C8))"

    Range("I12").Value = Range("I12").Value


End Sub

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