Verilen Alanda Hafta Sonu Günlerini İşaretle - Microsoft Excel


Verilen alanda gün metni geçiyorsa ve bu gün metni haftasonu günüyse ilgili hücreleri işaretleyen VBA kodudur.

Kod


Option Explicit

Sub VerilenAlandaHaftaSonuGunleriniIsaretle()
    Dim hucre As Range
    
    For Each hucre In Range("A1:T20")
        If hucre = "Cumartesi" Or hucre = "Pazar" Then
            With hucre.Interior
                .Pattern = xlGray75
                .PatternColorIndex = 42
            End With
        End If
    Next
End Sub

Etiketler
microsoft excel microsoft excel vba