Ironman
Well-known Member
- Joined
- Jan 31, 2004
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
Hi
The below code is perfect when the result is 2 or more, but looks clumsy when it's only 1.
I'd be really grateful for an amendment to the above that changes the message from "miles" to "mile" when the value of CLng(Range("MilesToNextYearEndTotal")) or CLng(Abs(.Value)) is 1.
Many thanks!
The below code is perfect when the result is 2 or more, but looks clumsy when it's only 1.
VBA Code:
MsgBox Format(Date, "dddd d mmmm, yyyy") & ":" & vbNewLine & vbNewLine _
& "If you're going for a run today, then before this run:" & vbNewLine & vbNewLine _
& "- You were " & CLng(Range("MilesToNextYearEndTotal")) & " miles behind the " & Range("PreYear") & " year end total" & vbNewLine & vbNewLine _
& "- You were " & CLng(Abs(.Value)) & " miles behind the " & Year(Now) - 1 & " year to date total", vbInformation, "Miles Run YTD"
Many thanks!