Hücredeki verinin hangi tipe tekabül ettiğini mesaj olarak gösteren VBA kodu alternatifidir.
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
Eğer tarih formülle üretilmişse hem formül hem de tarih olarak mesaj gösterilecektir.