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

اخفاء الصفوف بشرط من قائمة


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

السلام عليكم 

الاخوة والاخوات 

اذا تكرمتوا احد يساعدني في كود اخفاء الصفوف بشرط من قائمة منسدلة بحسب اختيار الشرط يتم اخفاء عدد محدد من الصفوف واظهار الباقية وعند اختيار من القائمة شرط ثاني يتم اخفاء عدد اخر من الصفوف واظهار الباقية مرفق ملف للشرح 

شاكر ومقدر مقدما 

ولكم جزيل الشكر 

كود اخفاء الصفوف بشرط.xlsx

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

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

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

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$2" And Target.Value = "0" Then
        Rows("15:200").EntireRow.Hidden = True
    End If
End Sub

 

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

In worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim v
    If Target.Address = "$B$2" Then
        v = Target.Value
        Rows("15:200").Hidden = False
        If v = 0 Then
            Rows("15:200").Hidden = True
        ElseIf v = Range("N67").Value Then
            Rows("51:200").Hidden = True
        ElseIf v = Range("N68").Value Then
            Rows("15:50").Hidden = True
            Rows("71:200").Hidden = True
        ElseIf v = Range("N69").Value Then
            Rows("15:70").Hidden = True
            Rows("151:200").Hidden = True
        ElseIf v = Range("N70").Value Then
            Rows("15:150").Hidden = True
        End If
    End If
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