Haftanın Günlerini Mesaj Olarak Göster - Microsoft Excel


Haftanın günlerini arada virgül olacak şekilde bir metne yazdıran ve yazdırılan bu metni mesaj olarak gösteren VBA kodu alternatifidir.

Kod


Option Explicit

Sub HaftaninGunleriniMesajOlarakGoster()
    Dim sonuc As String
    Dim metin As String
    Dim i     As Long
    
    metin = ""
    
    For i = 1 To 7
        If metin = "" Then
            metin = WeekdayName(i)
        Else
            metin = metin + ", " + WeekdayName(i)
        End If
    Next
    
    MsgBox metin
End Sub

Etiketler
microsoft excel microsoft excel vba microsoft excel vba tarih saat işlemleri