- Katılım
- 15 Mart 2005
- Mesajlar
- 43,833
- Excel Vers. ve Dili
- Microsoft 365 Tr-En 64 Bit
Forumda koşullu biçimlendirme ifadesi ile arama yapınız. Bu konuda oldukça fazla örnek var.
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Korhan Beyin yaptığı makro ile renk süzme kodları var ve kullanıyorum.
Gayetde güzel performans veriyor.
ücrelerde formül olmayacağı için
Sanırım tablonuza uyarlayabilrseniz işinizi görür,hücrelerde formül olmayacağı için sıkıntı kalkar.
Option Explicit
Sub RENKLENDİR()
Dim HÜCRE As Range, BUL As Range
Range("A25:K65536").Interior.ColorIndex = xlNone
For Each HÜCRE In Range("B25:B" & Range("B65536").End(3).Row)
If HÜCRE.Value <> Empty Then
Set BUL = Sheets("Sayfa8").Range("A:A").Find(HÜCRE.Value, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "BANKA VE PTT" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 38
If UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "BANKA VE PTT" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 12
ElseIf UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "EVİNE GİDİLECEK (TELEFONLA ULAŞILAMIYOR)" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 5
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "ÖZEL TAKİP" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 43
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "MUSTAFA BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 10
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "ÇEK VERECEK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 6
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "KREDİ KARTI İLE ÖDEME YAPACAK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 7
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "HAYATİ BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 33
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "FATİH BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 51
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "İSMAİL BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 11
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "YASEMİN HANIM" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 12
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "HATİCE ALTINOK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 14
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "KADRİ BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 15
Else
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 38
End If
End If
End If
Next
Set BUL = Nothing
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Ayrıca koşulda üçden fazla verebilirsiniz.
Sub RENKLENDİR()
Dim HÜCRE As Range
For Each HÜCRE In Range("g2:g" & [a65536].End(3).Row)
With HÜCRE.Interior
Select Case True
Case InStr(1, HÜCRE.Value, "Ocak")
.ColorIndex = 4
Case InStr(1, HÜCRE.Value, "Şubat")
.ColorIndex = 7
Case InStr(1, HÜCRE.Value, "Mart")
.ColorIndex = 5
Case InStr(1, HÜCRE.Value, "Nisan")
.ColorIndex = 6
Case InStr(1, HÜCRE.Value, "Mayıs")
.ColorIndex = 8
Case InStr(1, HÜCRE.Value, "Haziran")
.ColorIndex = 9
Case InStr(1, HÜCRE.Value, "Temmuz")
.ColorIndex = 27
Case InStr(1, HÜCRE.Value, "Ağustos")
.ColorIndex = 33
Case InStr(1, HÜCRE.Value, "Eylül")
.ColorIndex = 40
Case InStr(1, HÜCRE.Value, "Ekim")
.ColorIndex = 46
Case InStr(1, HÜCRE.Value, "Kasım")
.ColorIndex = 11
Case InStr(1, HÜCRE.Value, "Aralık")
.ColorIndex = 12
Case Else
.ColorIndex = 0
End Select
End With
Next
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [G:G]) Is Nothing Then Exit Sub
satirlar = "A" & Target.Row & ":G" & Target.Row
Select Case Target
Case "Ocak": Range(satirlar).Interior.ColorIndex = 3
Case "Şubat": Range(satirlar).Interior.ColorIndex = 4
Case "Mart": Range(satirlar).Interior.ColorIndex = 5
Case "Nisan": Range(satirlar).Interior.ColorIndex = 6
Case "Mayıs": Range(satirlar).Interior.ColorIndex = 7
Case "Haziran": Range(satirlar).Interior.ColorIndex = 8
Case "Temmuz": Range(satirlar).Interior.ColorIndex = 9
Case "Ağustos": Range(satirlar).Interior.ColorIndex = 10
Case "Eylül": Range(satirlar).Interior.ColorIndex = 11
Case "Ekim": Range(satirlar).Interior.ColorIndex = 12
Case "Kasım": Range(satirlar).Interior.ColorIndex = 13
Case "Aralık": Range(satirlar).Interior.ColorIndex = 14
End Select
End Sub
Sub Tahsinabi()
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [G:G]) Is Nothing Then Exit Sub
satirlar = "A" & Target.Row & ":G" & Target.Row
Select Case Target
Case "Ocak": Range(satirlar).Interior.ColorIndex = 3
Case "Şubat": Range(satirlar).Interior.ColorIndex = 4
Case "Mart": Range(satirlar).Interior.ColorIndex = 5
Case "Nisan": Range(satirlar).Interior.ColorIndex = 6
Case "Mayıs": Range(satirlar).Interior.ColorIndex = 7
Case "Haziran": Range(satirlar).Interior.ColorIndex = 8
Case "Temmuz": Range(satirlar).Interior.ColorIndex = 9
Case "Ağustos": Range(satirlar).Interior.ColorIndex = 10
Case "Eylül": Range(satirlar).Interior.ColorIndex = 11
Case "Ekim": Range(satirlar).Interior.ColorIndex = 12
Case "Kasım": Range(satirlar).Interior.ColorIndex = 13
Case "Aralık": Range(satirlar).Interior.ColorIndex = 14
End Select
End Sub
Sub F2_ENTER()
Dim Hucre As Range
Range("g1").Select
For Each Hucre In Range("g2:g1000")'satır sonunu kendine göre belirle
SendKeys "{F2}~", True
Next
End Sub
Korhan Beyin yaptığı makro ile renk süzme kodları var ve kullanıyorum.
Gayetde güzel performans veriyor.
ücrelerde formül olmayacağı için
Sanırım tablonuza uyarlayabilrseniz işinizi görür,hücrelerde formül olmayacağı için sıkıntı kalkar.
Option Explicit
Sub RENKLENDİR()
Dim HÜCRE As Range, BUL As Range
Range("A25:K65536").Interior.ColorIndex = xlNone
For Each HÜCRE In Range("B25:B" & Range("B65536").End(3).Row)
If HÜCRE.Value <> Empty Then
Set BUL = Sheets("Sayfa8").Range("A:A").Find(HÜCRE.Value, LookAt:=xlWhole)
If Not BUL Is Nothing Then
If UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "BANKA VE PTT" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 38
If UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "BANKA VE PTT" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 12
ElseIf UCase(Sheets("Sayfa8").Cells(BUL.Row, "F")) = "EVİNE GİDİLECEK (TELEFONLA ULAŞILAMIYOR)" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 5
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "ÖZEL TAKİP" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 43
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "MUSTAFA BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 10
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "ÇEK VERECEK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 6
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "KREDİ KARTI İLE ÖDEME YAPACAK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 7
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "HAYATİ BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 33
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "FATİH BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 51
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "İSMAİL BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 11
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "YASEMİN HANIM" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 12
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "HATİCE ALTINOK" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 14
ElseIf UCase(Replace(Replace(Sheets("Sayfa8").Cells(BUL.Row, "F"), "ı", "I"), "i", "İ")) = "KADRİ BEY" Then
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 15
Else
Range("A" & HÜCRE.Row, "K" & HÜCRE.Row).Interior.ColorIndex = 38
End If
End If
End If
Next
Set BUL = Nothing
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Ayrıca koşulda üçden fazla verebilirsiniz.