Aktif Hücrenin İçerik Tipini Mesaj Olarak Göster - Microsoft Excel


Hücredeki verinin hangi tipe tekabül ettiğini mesaj olarak gösteren VBA kodu alternatifidir.

Kod


Option Explicit

Sub AktifHucreninIcerikTipiniMesajOlarakGoster()
    '---------------------------------------
    'Formül
    '---------------------------------------
    If ActiveCell.HasFormula Then
        MsgBox "Formül"
    End If
    
    '---------------------------------------
    'Boş Hücre
    '---------------------------------------
    If ActiveCell = Empty Then
        MsgBox "Boş Hücre"
    End If
    
    '---------------------------------------
    'Metin
    '---------------------------------------
    If Application.IsText(ActiveCell) = True Then
        MsgBox "Metin"
    End If
        
    '---------------------------------------
    'Tarih
    '---------------------------------------
    If IsDate(ActiveCell.Value) = True Then
        MsgBox "Tarih"
    End If
End Sub

Not

Eğer tarih formülle üretilmişse hem formül hem de tarih olarak mesaj gösterilecektir.

Etiketler
microsoft excel microsoft excel vba microsoft excel vba aktif hücre işlemleri