rjwebgraphix
Well-known Member
- Joined
- May 25, 2010
- Messages
- 590
How can I get this to show the name of the month in the msgbox instead of the date? The usage date comes from a cell which is already formatted to display the month name, but is really just a date.
Code:
Sheets("Datasheet").Activate
UsageDate = Sheets("Summary").Cells(4, "A")
With Sheets("Datasheet")
lrow = 2
Do While Cells(lrow, "A") <> ""
DateToChk = Cells(lrow, "O")
If Month(UsageDate) = Month(DateToChk) Then
GoTo ChkDistrict
End If
lrow = lrow + 1
Loop
Sheets("IMPORTER").Activate
MsgBox ("There is no data in the file for the month of " & UsageDate & (Chr(13)) & _
"Either change the date or import a file with data for that month."), vbCritical
Exit Sub
End With