K
Klatuu
This is an unusual Friday the 13th in that all the digits in the date add up
to 13
1+1+3+2+6 = 13
The last time that happened was January 13, 1520
1+1+3+1+5+2
What to know when it will happen again?
Here is a function that will calculate it:
Public Function WhenIs13() As Date
Dim dtmStart As Date
Dim strDate As String
Dim lngCtr As Long
Dim lngTot As Long
dtmStart = #11/13/2006#
Do While True
dtmStart = DateAdd("m", 1, dtmStart)
Do Until Weekday(dtmStart) = 6
dtmStart = DateAdd("m", 1, dtmStart)
Loop
strDate = Format(dtmStart, "yyyymmdd")
strDate = Replace(strDate, "0", "")
lngTot = 0
For lngCtr = 1 To Len(strDate)
lngTot = lngTot + CLng(Mid(strDate, lngCtr, 1))
Next lngCtr
If lngTot = 13 Then
WhenIs13 = dtmStart
Exit Do
End If
Loop
End Function
to 13
1+1+3+2+6 = 13
The last time that happened was January 13, 1520
1+1+3+1+5+2
What to know when it will happen again?
Here is a function that will calculate it:
Public Function WhenIs13() As Date
Dim dtmStart As Date
Dim strDate As String
Dim lngCtr As Long
Dim lngTot As Long
dtmStart = #11/13/2006#
Do While True
dtmStart = DateAdd("m", 1, dtmStart)
Do Until Weekday(dtmStart) = 6
dtmStart = DateAdd("m", 1, dtmStart)
Loop
strDate = Format(dtmStart, "yyyymmdd")
strDate = Replace(strDate, "0", "")
lngTot = 0
For lngCtr = 1 To Len(strDate)
lngTot = lngTot + CLng(Mid(strDate, lngCtr, 1))
Next lngCtr
If lngTot = 13 Then
WhenIs13 = dtmStart
Exit Do
End If
Loop
End Function