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

ملئ الفراغ


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

السلام عليكم

أخي العزيز

ضع الكود التالي في حدث الورقة

 

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
st = 1
If IsEmpty([B1]) Then st = [B1].End(xlDown).Row
LR = [B9999].End(xlUp).Row
Range("B" & st & ":B" & LR).Select
Selection.Sort Key1:=Range("B" & st), Order1:=xlAscending, Header:=xlNo
Range("B" & st).Select
Application.ScreenUpdating = True
End Sub 

 

أو تفضل الملف وبه الكود

جرب أن تلغي أو تضيف أي شيء في العمود B

Book1_2.rar

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

بارك الله فيك أخي الكريم طارق محمود على الكود الذي أحتاجه

و لكن لا أدري لماذا لم يشتغل معي - مع العلم أنني مبتدئ  في هذا المجال -

و إذ أرفق الملف مع مشاركتي و لكن طمعي أكثر في شرح سبب عدم اشتغاله أكثر من طمعي في إصلاح الخطأ

و تقبل تحياتي الحارة

Classeur1.rar

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

السلام عليكم

أخي الكريم

كان الأولي أن ترفق هذا الملف من الأول

علي كل حال

استبدل الكود بالتالي

 

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
Application.ScreenUpdating = False
[A11:M40].Sort Key1:=[B11], Order1:=xlAscending, Header:=xlNo
    For r = 11 To 40
        If Cells(r, 2).Value = "" Then
            Cells(r, 14) = 99
        Else
            Cells(r, 14) = r
        End If
    Next
[B11:N40].Sort Key1:=[N11], Order1:=xlAscending, Header:=xlNo
[N11:N40].ClearContents
Application.ScreenUpdating = True
End Sub

أو تفضل المرفق

 

Classeur1_2.rar

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

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