- Katılım
- 5 Nisan 2009
- Mesajlar
- 533
- Excel Vers. ve Dili
- 2003-2007
Değerli Üstadlar,
Aşağıdaki makro ile 56 koşullu biçimlendirme (Daha doğrusu renklendirme) yapabiliyorum.Bu biçimlendirmede yazı tipi rengimiz otomatikman siyak oluyor zaten.Tabiiki istersek tüm sütunda yazı tipi rengini örneğin beyaz da yapabiliyoruz.Benim isteğim ise aşağıdaki makroyu uygulamak ama bununla sadece desen rengini değil,aynı zamanda yazı rengini de belirlemek.Gerçi daha önce sayın Korhan AYHAN üstadımızın "Font'a göre 56 koşullu biçimlendirme"başlığı ile açtığım konuya vermiş olduğu bir cevap var.Ama o çalışmada da sadece yazı tipi ve yazı renkleri belirlenmiş.Oysa tam olarak istediğim 56 koşullu biçimlendirme ile renkleri belirlerken her renk için de ayrı bir yazı rengi belirleyebilelim.Örneğin sarı desen siyah-kalın yazı,kırmızı desen beyaz kalın yazı,mavi desen sarı yazı rengi gibi.Aşağıdaki makro içerisine bunu nasıl yerleştirebiliriz?Ya da başka bir yöntem var mı?Teşekkür eder,iyi geceler dilerim.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo ws_exit:
Set rng = Application.Intersect(Target, Me.Range("I3:J5000"))
If rng Is Nothing Then Exit Sub
With Target
Select Case UCase(.Value)
Case Is = "MİLAS": .Interior.ColorIndex = 10
Case Is = "FETHİYE": .Interior.ColorIndex = 10
Case Is = "KÖYCEĞİZ": .Interior.ColorIndex = 10
Case Is = "BODRUM", "MUĞLA": .Interior.ColorIndex = 10
Case Is = "DALAMAN": .Interior.ColorIndex = 10
Case Is = "ORTACA": .Interior.ColorIndex = 10
Case Is = "MARMARİS": .Interior.ColorIndex = 10
Case Is = "ULA": .Interior.ColorIndex = 10
Case Is = "YATAĞAN": .Interior.ColorIndex = 10
Case Is = "DATÇA": .Interior.ColorIndex = 10
Case Is = "GERMENCİK", "AYDIN": .Interior.ColorIndex = 3
Case Is = "İNCİRLİOVA": .Interior.ColorIndex = 3
Case Is = "SÖKE": .Interior.ColorIndex = 3
Case Is = "İNCİRLİOVA": .Interior.ColorIndex = 3
Case Is = "KOÇARLI": .Interior.ColorIndex = 3
Case Is = "YENİPAZAR": .Interior.ColorIndex = 3
Case Is = "KARPUZLU": .Interior.ColorIndex = 3
Case Is = "KUŞADASI": .Interior.ColorIndex = 3
Case Is = "KÖŞK": .Interior.ColorIndex = 3
Case Is = "SULTANHİSAR": .Interior.ColorIndex = 3
Case Is = "NAZİLLİ": .Interior.ColorIndex = 3
Case Is = "BOZDOĞAN": .Interior.ColorIndex = 3
Case Is = "KUYUCAK": .Interior.ColorIndex = 3
Case Is = "BUHARKENT": .Interior.ColorIndex = 3
Case Is = "KARACASU": .Interior.ColorIndex = 3
Case Is = "ÇİNE": .Interior.ColorIndex = 3
Case Is = "MERKEZ": .Interior.ColorIndex = 1
Case Is = "ACIPAYAM", "DENİZLİ": .Interior.ColorIndex = 32
Case Is = "SERİNHİSAR": .Interior.ColorIndex = 32
Case Is = "TAVAS": .Interior.ColorIndex = 32
Case Is = "KALE": .Interior.ColorIndex = 32
Case Is = "HONAZ": .Interior.ColorIndex = 32
Case Is = "SARAYKÖY": .Interior.ColorIndex = 32
Case Is = "BABADAĞ": .Interior.ColorIndex = 32
Case Is = "BEYAĞAÇ": .Interior.ColorIndex = 32
Case Is = "ÇARDAK": .Interior.ColorIndex = 32
Case Is = "BOZKURT": .Interior.ColorIndex = 32
Case Is = "AKKÖY": .Interior.ColorIndex = 32
Case Is = "ÇİVRİL": .Interior.ColorIndex = 32
Case Is = "ÇAL": .Interior.ColorIndex = 32
Case Is = "BEKİLLİ": .Interior.ColorIndex = 32
Case Is = "BAKLAN": .Interior.ColorIndex = 32
Case Is = "ÇAMELİ": .Interior.ColorIndex = 32
Case Is = "GÜNEY": .Interior.ColorIndex = 32
Case Is = "BULDAN": .Interior.ColorIndex = 32
Case Is = "ÇANKAYA": .Interior.ColorIndex = 22
Case Is = "ANKARA": .Interior.ColorIndex = 22
Case Is = "DİDİM": .Interior.ColorIndex = 3
Case Is = "KAVAKLIDERE": .Interior.ColorIndex = 10
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
ws_exit:
End Sub
Aşağıdaki makro ile 56 koşullu biçimlendirme (Daha doğrusu renklendirme) yapabiliyorum.Bu biçimlendirmede yazı tipi rengimiz otomatikman siyak oluyor zaten.Tabiiki istersek tüm sütunda yazı tipi rengini örneğin beyaz da yapabiliyoruz.Benim isteğim ise aşağıdaki makroyu uygulamak ama bununla sadece desen rengini değil,aynı zamanda yazı rengini de belirlemek.Gerçi daha önce sayın Korhan AYHAN üstadımızın "Font'a göre 56 koşullu biçimlendirme"başlığı ile açtığım konuya vermiş olduğu bir cevap var.Ama o çalışmada da sadece yazı tipi ve yazı renkleri belirlenmiş.Oysa tam olarak istediğim 56 koşullu biçimlendirme ile renkleri belirlerken her renk için de ayrı bir yazı rengi belirleyebilelim.Örneğin sarı desen siyah-kalın yazı,kırmızı desen beyaz kalın yazı,mavi desen sarı yazı rengi gibi.Aşağıdaki makro içerisine bunu nasıl yerleştirebiliriz?Ya da başka bir yöntem var mı?Teşekkür eder,iyi geceler dilerim.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo ws_exit:
Set rng = Application.Intersect(Target, Me.Range("I3:J5000"))
If rng Is Nothing Then Exit Sub
With Target
Select Case UCase(.Value)
Case Is = "MİLAS": .Interior.ColorIndex = 10
Case Is = "FETHİYE": .Interior.ColorIndex = 10
Case Is = "KÖYCEĞİZ": .Interior.ColorIndex = 10
Case Is = "BODRUM", "MUĞLA": .Interior.ColorIndex = 10
Case Is = "DALAMAN": .Interior.ColorIndex = 10
Case Is = "ORTACA": .Interior.ColorIndex = 10
Case Is = "MARMARİS": .Interior.ColorIndex = 10
Case Is = "ULA": .Interior.ColorIndex = 10
Case Is = "YATAĞAN": .Interior.ColorIndex = 10
Case Is = "DATÇA": .Interior.ColorIndex = 10
Case Is = "GERMENCİK", "AYDIN": .Interior.ColorIndex = 3
Case Is = "İNCİRLİOVA": .Interior.ColorIndex = 3
Case Is = "SÖKE": .Interior.ColorIndex = 3
Case Is = "İNCİRLİOVA": .Interior.ColorIndex = 3
Case Is = "KOÇARLI": .Interior.ColorIndex = 3
Case Is = "YENİPAZAR": .Interior.ColorIndex = 3
Case Is = "KARPUZLU": .Interior.ColorIndex = 3
Case Is = "KUŞADASI": .Interior.ColorIndex = 3
Case Is = "KÖŞK": .Interior.ColorIndex = 3
Case Is = "SULTANHİSAR": .Interior.ColorIndex = 3
Case Is = "NAZİLLİ": .Interior.ColorIndex = 3
Case Is = "BOZDOĞAN": .Interior.ColorIndex = 3
Case Is = "KUYUCAK": .Interior.ColorIndex = 3
Case Is = "BUHARKENT": .Interior.ColorIndex = 3
Case Is = "KARACASU": .Interior.ColorIndex = 3
Case Is = "ÇİNE": .Interior.ColorIndex = 3
Case Is = "MERKEZ": .Interior.ColorIndex = 1
Case Is = "ACIPAYAM", "DENİZLİ": .Interior.ColorIndex = 32
Case Is = "SERİNHİSAR": .Interior.ColorIndex = 32
Case Is = "TAVAS": .Interior.ColorIndex = 32
Case Is = "KALE": .Interior.ColorIndex = 32
Case Is = "HONAZ": .Interior.ColorIndex = 32
Case Is = "SARAYKÖY": .Interior.ColorIndex = 32
Case Is = "BABADAĞ": .Interior.ColorIndex = 32
Case Is = "BEYAĞAÇ": .Interior.ColorIndex = 32
Case Is = "ÇARDAK": .Interior.ColorIndex = 32
Case Is = "BOZKURT": .Interior.ColorIndex = 32
Case Is = "AKKÖY": .Interior.ColorIndex = 32
Case Is = "ÇİVRİL": .Interior.ColorIndex = 32
Case Is = "ÇAL": .Interior.ColorIndex = 32
Case Is = "BEKİLLİ": .Interior.ColorIndex = 32
Case Is = "BAKLAN": .Interior.ColorIndex = 32
Case Is = "ÇAMELİ": .Interior.ColorIndex = 32
Case Is = "GÜNEY": .Interior.ColorIndex = 32
Case Is = "BULDAN": .Interior.ColorIndex = 32
Case Is = "ÇANKAYA": .Interior.ColorIndex = 22
Case Is = "ANKARA": .Interior.ColorIndex = 22
Case Is = "DİDİM": .Interior.ColorIndex = 3
Case Is = "KAVAKLIDERE": .Interior.ColorIndex = 10
Case Else
.Interior.ColorIndex = xlNone
End Select
End With
ws_exit:
End Sub
