zoso
Well-known Member
- Joined
- Oct 23, 2003
- Messages
- 725
I have a worksheet called Training Log, which is a running diary.
Cells A1:A11 are filled with misc formulas. Cells A12 onwards contain dates from 1998 to the present day.
I usually add an entry every day but this may not always be so and am currently down to A1702 - I eventually expect cells will be filled with dates to no more than A20000.
The current year starts in row 1680, but if possible, I'd like the code to be able to determine if we're in a new year automatically so I can avoid amending the code in future years.
Column C cells A12 onwards contain distance run in number format to 1 decimal place.
Column D cells A12 onwards contain hours run in the format: [h]:mm:ss
What I would be really grateful for, if this is possible, is for a msgbox to popup in 2 instances:
a) when the DISTANCE I have run is greater than at any date in the current year to date.
b) when the TIME I have run is longer than at any date in the current year to date.
The msgboxes could be something like:
a) Congratulations - you've just run the furthest distance you've run all year
b) Congratulations - you've just been running for the longest session since the start of the year.
Also, I suppose it goes without saying, but I am keen to avoid the code looping, so when I have clicked the msgbox it doesn't keep appearing - maybe if it just ran once until the figure increases later in the year, or something like that?
If it helps at all, Column A cell A2 always contains todays date.
Hope this is possible - and if so, thanks a lot in advance!
Cells A1:A11 are filled with misc formulas. Cells A12 onwards contain dates from 1998 to the present day.
I usually add an entry every day but this may not always be so and am currently down to A1702 - I eventually expect cells will be filled with dates to no more than A20000.
The current year starts in row 1680, but if possible, I'd like the code to be able to determine if we're in a new year automatically so I can avoid amending the code in future years.
Column C cells A12 onwards contain distance run in number format to 1 decimal place.
Column D cells A12 onwards contain hours run in the format: [h]:mm:ss
What I would be really grateful for, if this is possible, is for a msgbox to popup in 2 instances:
a) when the DISTANCE I have run is greater than at any date in the current year to date.
b) when the TIME I have run is longer than at any date in the current year to date.
The msgboxes could be something like:
a) Congratulations - you've just run the furthest distance you've run all year
b) Congratulations - you've just been running for the longest session since the start of the year.
Also, I suppose it goes without saying, but I am keen to avoid the code looping, so when I have clicked the msgbox it doesn't keep appearing - maybe if it just ran once until the figure increases later in the year, or something like that?
If it helps at all, Column A cell A2 always contains todays date.
Hope this is possible - and if so, thanks a lot in advance!