Koşullu Biçimlendirme

Katılım
24 Şubat 2006
Mesajlar
243
Excel Vers. ve Dili
EXCEL 2003
Dim zzz As Long
For zzz = 4 To [Z100].End(3).Row
If Cells(zzz, 1) = "Genel Toplam" Then

Cells(zzz, 1).Font.Bold = True
Cells(zzz, 2).Font.Bold = True
Cells(zzz, 3).Font.Bold = True
Cells(zzz, 4).Font.Bold = True
Cells(zzz, 5).Font.Bold = True
Cells(zzz, 6).Font.Bold = True
Cells(zzz, 7).Font.Bold = True
Cells(zzz, 8).Font.Bold = True
Cells(zzz, 9).Font.Bold = True
Cells(zzz, 10).Font.Bold = True
Cells(zzz, 11).Font.Bold = True
Cells(zzz, 12).Font.Bold = True
Cells(zzz, 13).Font.Bold = True
Cells(zzz, 14).Font.Bold = True
Cells(zzz, 15).Font.Bold = True
Cells(zzz, 16).Font.Bold = True
Cells(zzz, 17).Font.Bold = True
Cells(zzz, 18).Font.Bold = True
Cells(zzz, 19).Font.Bold = True
Cells(zzz, 20).Font.Bold = True
Cells(zzz, 21).Font.Bold = True
Cells(zzz, 22).Font.Bold = True
Cells(zzz, 23).Font.Bold = True
Cells(zzz, 24).Font.Bold = True
Cells(zzz, 25).Font.Bold = True
Cells(zzz, 26).Font.Bold = True

Else

Cells(zzz, 1).Font.Bold = False
Cells(zzz, 2).Font.Bold = False
Cells(zzz, 3).Font.Bold = False
Cells(zzz, 4).Font.Bold = False
Cells(zzz, 5).Font.Bold = False
Cells(zzz, 6).Font.Bold = False
Cells(zzz, 7).Font.Bold = False
Cells(zzz, 8).Font.Bold = False
Cells(zzz, 9).Font.Bold = False
Cells(zzz, 10).Font.Bold = False
Cells(zzz, 11).Font.Bold = False
Cells(zzz, 12).Font.Bold = False
Cells(zzz, 13).Font.Bold = False
Cells(zzz, 14).Font.Bold = False
Cells(zzz, 15).Font.Bold = False
Cells(zzz, 16).Font.Bold = False
Cells(zzz, 17).Font.Bold = False
Cells(zzz, 18).Font.Bold = False
Cells(zzz, 19).Font.Bold = False
Cells(zzz, 20).Font.Bold = False
Cells(zzz, 21).Font.Bold = False
Cells(zzz, 22).Font.Bold = False
Cells(zzz, 23).Font.Bold = False
Cells(zzz, 24).Font.Bold = False
Cells(zzz, 25).Font.Bold = False
Cells(zzz, 26).Font.Bold = False

End If
Next
End Sub


Arkadaşlar, sevgili dostlar, yukarıda verdiğim koşullu biçimlendirme makrosunu nasıl kısaltabilirim.

Diğer sorum ise, yukarıdaki makro satırlar için uygulanmakta, bunu sadece sütunlara vede hem satırlara-hem sütunlara nasıl uygulayabilirim.

(Ben bu kodları "Worksheet_Activate" bölümüne yazmıştım, daha iyi bir öneri varsa, onada açık olduğumu belirtimiş olayım.)
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
:cool:
Kod:
Dim zzz As Long, sut As Byte
For zzz = 4 To [Z100].End(3).Row
    If Cells(zzz, 1) = "Genel Toplam" Then
        For sut = 1 To 26
            Cells(zzz, sut).Font.Bold = True
        Next sut
    Else
        For sut = 1 To 26
            Cells(zzz, sut).Font.Bold = False
        Next sut
End If
Next
 
Katılım
24 Şubat 2006
Mesajlar
243
Excel Vers. ve Dili
EXCEL 2003
Evren hocam, ne zaman sıkıntıda olsam, maaşallah hızır gibi yetişiyorsunuz.

Ne diyeyim ki, ALLAH razı olsun.

Hayırlı geceler.
 

Korhan Ayhan

Administrator
Yönetici
Admin
Katılım
15 Mart 2005
Mesajlar
42,684
Excel Vers. ve Dili
Microsoft 365 Tr-En 64 Bit
Selamlar,

Alternatif olarak aşağıdaki koduda kullanabilirsiniz. Evren beyin önerdiği kodun biraz daha kısaltılmış halidir.

Kod:
Sub DÜZENLE()
    Dim Satır As Long
    For Satır = 4 To [Z100].End(3).Row
    Range("A" & Satır & ":Z" & Satır).Font.Bold = IIf(Cells(Satır, 1) = "Genel Toplam", True, False)
    Next
End Sub
 
Katılım
24 Şubat 2006
Mesajlar
243
Excel Vers. ve Dili
EXCEL 2003
Korhan hocam teşekkürler.
 
Üst