Sub test1()
Dim daterecherchee As Variant
daterecherchee = CVar(ThisWorkbook.Worksheets("Test").Cells(6, 1).Value)
If TypeName(daterecherchee) = "Date" And TypeName(daterecherchee) <> "Empty" Then
MsgBox "Ceci est une vraie date" & ThisWorkbook.Worksheets("Test").Cells(6, 1).Value
End If
If TypeName(daterecherchee) = "Double" Then
MsgBox "ceci est une valeur numérique" & ThisWorkbook.Worksheets("Test").Cells(6, 1).Value
End If
Call test2
End Sub
Sub test2()
Dim daterecherchee As Variant
daterecherchee = CVar(ThisWorkbook.Worksheets("Test").Cells(13, 2).Value)
If TypeName(daterecherchee) = "Date" And TypeName(daterecherchee) <> "Empty" Then
MsgBox "Ceci est une vraie date" & ThisWorkbook.Worksheets("Test").Cells(13, 2).Value
End If
If TypeName(daterecherchee) = "Double" Then
MsgBox "ceci est une valeur numérique" & ThisWorkbook.Worksheets("Test").Cells(13, 2).Value
End If
Call test3
End Sub
Sub test3()
Dim daterecherchee As Variant
daterecherchee = CVar(ThisWorkbook.Worksheets("Test").Cells(1, 6).Value)
If TypeName(daterecherchee) = "Date" And TypeName(daterecherchee) <> "Empty" Then
MsgBox "Ceci est une vraie date" & ThisWorkbook.Worksheets("Test").Cells(1, 6).Value
End If
If TypeName(daterecherchee) = "Empty" Then
MsgBox "La cellule est vide" & ThisWorkbook.Worksheets("Test").Cells(1, 6).Value
End If
End Sub