Saphirah
Active member
- Local time
- Today, 06:05
- Joined
- Apr 5, 2020
- Messages
- 163
Hello everyone,
in my VBA code i have 2 variables. VDate as Date and VString as String.
VString = "22.2"
VDate = 22.02.2021
I am now comparing those 2 in an if and the code inside the if is executed.
Is this intended behaviour? This does not make sense for me. Can someone explain this please?
Thank you very much in advance
in my VBA code i have 2 variables. VDate as Date and VString as String.
VString = "22.2"
VDate = 22.02.2021
I am now comparing those 2 in an if and the code inside the if is executed.
Code:
If VString = VDate Then
Debug.Print("Hello World")
End If
Output: Hello World
Is this intended behaviour? This does not make sense for me. Can someone explain this please?
Thank you very much in advance

Last edited: