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

طلب مساعدة في تنسيق شرطي


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

السلام عليكم 

الاخوة الاعزاء

ارجو منكم ان تساعدوني في التنسيق الشرطي

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

 

وجزاكم الله خيرا

 

نموذج3.xlsx

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

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

جرب هدا الحل بالاكواد  هل يناسبك 

Public Property Get ws() As Worksheet: Set ws = Sheet1
End Property
Private Sub ComboBox1_GotFocus()
Application.ScreenUpdating = False
Set d = CreateObject("Scripting.Dictionary")
  For Each c In ws.Range("O2", ws.Cells(Rows.Count, "O").End(xlUp))
    If Not d.Exists(c.Value) Then d(c.Value) = ""
  Next c
  MyRng = d.keys
 Me.ComboBox1.List = MyRng
End Sub
'*******************
Private Sub ComboBox1_Change()
Dim i&, lastrow&, r As Range, MyRng As Range
lastrow = ws.Columns("A:O").Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
Set MyRng = ws.Range("A2:O" & lastrow - 1): Set Tbl = ws.ListObjects("الجدول93")
Clé = ComboBox1
Application.ScreenUpdating = False
Tbl.Range.AutoFilter Field:=15, Criteria1:=Clé
For i = 2 To lastrow Step 2
    Set r = Range("A" & i & ":O" & i)
    If Cells(i, "O").Value = "الورشة" Then
           r.Interior.Color = RGB(51, 204, 204)
    ElseIf Cells(i, "O").Value = "التقنية" Then
           r.Interior.Color = RGB(255, 204, 153)
    ElseIf Cells(i, "O").Value = "التأجير" Then
           r.Interior.Color = RGB(255, 255, 0)
        Else
           r.Interior.ColorIndex = xlColorIndexNone
    End If
Next i
If Me.ComboBox1 = Empty Then Tbl.ShowAutoFilter = False: MyRng.Interior.ColorIndex = xlColorIndexNone
Application.ScreenUpdating = True
End Sub

 

 

نموذج3 .xlsb

تم تعديل بواسطه محمد هشام.
اظافة الالوان
  • 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