When month number is smaller than 10 code works fine. But for example now code says that month is different in cell W5 when comparing for this month. I guarantee that W5 has number 11!
What is wrong?
' taking month number
lmonth = Month(Now())
If lmonth < 10 Then
lmonth = "0" & lmonth
End If
If Range("W5").Value <> lmonth Then
Dim intButton As Integer
intButton = MsgBox("Bill month (" & Range("W5").Value & ") is different than this month (" & Month(Now()) & "). Continue?", _
vbOKCancel + vbInformation, "Yes")
If intButton = vbOK Then
' just go through
ElseIf intButton = vbCancel Then GoTo complete_end:
End If
End If
Bookmarks