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

استفسار عن خطاء فى كود


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

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

استفسار بخصوص كود

عملت كود vba

Sub deleteRows()

For Each cell In Selection
 If cell.Text = 1 Then
cell.EntireRow.Delete
End If
Next cell
End Sub

لكن لما اجى انفذه  على قيم مثل

1

1

0

1

1

بيمسح صف من الرقمين 1 ال فوق وصف من الرقمين 1 الل تحت لكن انا عايزه يمسح كل الصفوف ال فىها 1 مره واحده

مرفق الشيت

Book1.rar

رابط هذا التعليق
شارك

Sub deleterows()
    Dim i, j As Long
    i = Cells(Rows.Count, 7).End(xlUp).Row
    For j = i To 1 Step -1
        If Cells(j, 7) = 1 Then
            Cells(j, 7).EntireRow.Delete
        End If
    Next
End Sub

 

تم تعديل بواسطه shreif mohamed
رابط هذا التعليق
شارك

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