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

أين الخطأ في هذه الدالة بارك الله فيكم


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

تطبيق هذا الكود على نفس الملف 

Option Explicit
Sub copy_as_you_want()
Dim i, c As Integer
Dim Cont
Dim Lr As Long
Lr = ActiveSheet.Cells(Rows.count, 3).End(3).Row

Range("c3:c" & Lr).ClearContents
i = 3
c = 3

  Do While Cells(i, 1) <> ""
    Cont = Cells(i, 1).Offset(0, 1).Value
        If Not IsNumeric(Cont) Or Cont = "" Or Cont = 0 Then i = i + 1: GoTo 1
        Cont = Int(Abs(Cont))
     Range("c" & c & ":c" & c + Cont - 1).Value = Cells(i, 1).Value
    i = i + 1
    c = c + Cont
1:
  Loop
End Sub
رابط هذا التعليق
شارك

كان فى خطأ عند count if المفروض تكون o2 مش o3

والمفروض تدوس ctrl + shift +enter لكى تعمل الدالة

 

استاذ سليم.xlsx

تم تعديل بواسطه Emad Sabry
  • Thanks 1
رابط هذا التعليق
شارك

6 دقائق مضت, سليم حاصبيا said:

 

 

16 دقائق مضت, Emad Sabry said:

كان فى خطأ عند count if المفروض تكون o2 مش o3

والمفروض تدوس ctrl + shift +enter لكى تعمل الدالة

 

استاذ سليم.xlsx

شكراً لك استاذ عماد وصلت المعلومة وجزاك الله خيراً أستاذنا

  • 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