Msgbox when any one of a number of subtotals has been exceeded

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

A2:A243 (which is added to regularly) contains values and subtotals for each year.

The subtotals for each year are identified in blue and by a formula in Column B.

I need a message box to appear when the value in cell A245 exceeds a subtotal.

If a trigger cell is needed, then C245 can be used (so I can easily see it), although this will need to change when a new entry is added.

Many thanks!

Book1
AB
210
211136Tue 28/01/2020
212152Wed 05/02/2020
213144Sun 09/02/2020
214166Thu 13/02/2020
215156Mon 17/02/2020
216100Fri 21/02/2020
21798Tue 25/02/2020
21897Sat 29/02/2020
219126Wed 04/03/2020
220142Sun 08/03/2020
221103Thu 12/03/2020
22211TOTAL FOR 2020
223
224135Tue 22/06/2021
22557Sat 26/06/2021
226154Wed 30/06/2021
2277Sun 04/07/2021
228120Mon 12/07/2021
229124Fri 16/07/2021
23051Tue 20/07/2021
231162Sat 24/07/2021
23272Wed 28/07/2021
233101Sun 01/08/2021
2343Thu 05/08/2021
235110Mon 09/08/2021
23640Fri 13/08/2021
23777Tue 17/08/2021
23844Sat 21/08/2021
23968Wed 25/08/2021
2402Sun 29/08/2021
24189Thu 02/09/2021
2424Mon 06/09/2021
24376Fri 10/09/2021
244
24520TOTAL FOR 2021
Iron Man Log
Cell Formulas
RangeFormula
A224:A243,A211:A221A211=RANK(D211,$D$2:$D$245)
A222A222=COUNT(A211:A221)
B222B222="TOTAL FOR " & YEAR(B221)
A245A245=COUNT(A224:A244)
B245B245="TOTAL FOR " & YEAR(B243)
Named Ranges
NameRefers ToCells
Iron_Mans_2020='Iron Man Log'!$A$211:$A$221A222
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A210Cell Value=""textNO
A245Cell Value=""textNO
A244Cell Value=""textNO
A222Cell Value=""textNO
A223Cell Value=""textNO
A2:A6,A211:A221,A182:A208,A177:A179,A153:A174,A149:A150,A138:A146,A112:A135,A98:A109,A90:A95,A87,A78:A84,A75,A68:A72,A58:A65,A55,A50:A52,A38:A43,A35,A23:A32,A9:A20,A224:A243,A46:A47Cell Value=1textYES
A2:A6,A211:A221,A182:A208,A177:A179,A153:A174,A149:A150,A138:A146,A112:A135,A98:A109,A90:A95,A87,A78:A84,A75,A68:A72,A58:A65,A55,A50:A52,A38:A43,A35,A23:A32,A9:A20,A224:A243,A46:A47Cell Value=2textYES
A2:A6,A211:A221,A182:A208,A177:A179,A153:A174,A149:A150,A138:A146,A112:A135,A98:A109,A90:A95,A87,A78:A84,A75,A68:A72,A58:A65,A55,A50:A52,A38:A43,A35,A23:A32,A9:A20,A224:A243,A46:A47Cell Valuebetween 3 and 10textYES
A2:A6,A211:A221,A182:A208,A177:A179,A153:A174,A149:A150,A138:A146,A112:A135,A98:A109,A90:A95,A87,A78:A84,A75,A68:A72,A58:A65,A55,A50:A52,A38:A43,A35,A23:A32,A9:A20,A224:A243,A46:A47,A246:A531Cell Value=""textNO
Cells with Data Validation
CellAllowCriteria
A245Whole number=12345
A222Whole number=12345
 
So I'm OK highlighting the blank (current) row 222 and inserting new rows from there?
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Er, this is Row 223 right now (unchanged from Post #45)
198<<< TOTAL No. IRON MAN RUNS 1984-2021

You mean keep the row above it (222) blank or what should I be doing with the data in 223 because I still need it?
 
Upvote 0
That's what I've been telling you....you moved that from further down and it affected the code.
"currentregion" in the code means just that, and now row 223 is in the current region....which you don't want !
Yes, just.....keep 223 blank!, so there is a seperation between the regions.
When you add another line to the bottom of the table, it then becomes a part of thet region...which is OK, but DO NOT add anything at the top of the region, ie, ROW 223 !!!!
Exercise Log.xlsm
ABCDE
246112020702020
247202021442021
Iron Man Log
 
Upvote 0
Understood (finally :biggrin:), so from what you've said, there's nowhere for it to go because you said that anything added below the table must be in the same format - which row 223 isn't.

Can I cut and paste it to row 222 and then create a blank row above that?
 
Upvote 0
Mate, I don't care where it goes, as long as it isn't at the bottm of the ranikings block of data AND there is a blank row directly above the rankings block title row.
Exercise Log.xlsm
ABCDE
224TOTYEARRK/23No. >3HRSYEAR
Iron Man Log
 
Upvote 0
OK just to clarify...from what you said the row above the table needs to be blank, which it now is (but it's not row 223!) - is this OK?
Book1
ABCDEF
2204Mon 06/09/202115.13:46:2415:001:30pm, 20-21ºC, cloudy, warm and sunny, light breeze. 11 hours of blissful sleep without being woken by that ****ing dog, then ate banana and 3 pts of squash (knew it would be warm out). Perforated t-shirt, racing shorts - perfect. Vaselined fingers, no nail-biting. Wanted to do this route but when I got out into the warm sunshine I thought I'd better play safe and go up the canal so I know how far I'll be going, but as I was approaching The Fisherman's I thought "sod it, I'm going right". And no regrets, it was pure, fresh eye candy, SO much more interesting, "this is the future of the canal runs" I thought. Much nicer setting, no monotony, so many landmarks. Complimented a beautiful woman on her nice fragrance wafting way behind her as I passed her! Echoes playing on Walkman as I approached the 2 imposing halves of Salts Mill either side of the canal - very atmospheric! Despite the views, lower back ached for the full length of the canal section. R nipple chafed from the sweat. Had planned to go back over the 3-Rise but when I saw the potential mileage I decided to go up to the top of the 5-Rise and back down (measured 0.34M from 3-Rise to top of 5-Rise - exactly the same as from home up to the junction of Bents Ln!). Wasn't as hard as I'd imagine it'd be while I was running towards Saltaire. Left hamstring got really tight from about 10M but just about held my normal stride. Got increasingly tired over last 5M but as ever - my eyes were pleading for encouragement from oncoming walkers (one or two women did!), but my head and my quads strength saw me through. My first words when I got back? "Jesus". "Jesus". I don't know how I did it. Well I do know - with a super powerful mind and strong quads from all the biking! Very satisfying run.
22176Fri 10/09/202110.62:32:4214:243:00pm, 20-18ºC, bit humid, one or two light but welcome showers. Heart bit tired B4 setting out. Vaselined fingers, no nail-biting again! Forgot to wear bandana (they were both on clothes horse upstairs) and regretted it, heavy sweating and rain were a PITA. Wore tracksters and perforated t-shirt. Pee stop junction of Old Allen Rd/Back Ln. R nipple really chafed despite vaselining it B4 setting out (bloke in car with little girl in front passenger seat going my way stopped car alongside me near bottom of Greenside Ln and asked on behalf of the little girl (!) if I was OK - assumed it was cos of me crawling up the road until I got in and saw all the blood/sweat staining down my t-shirt). I'm renaming Lee Ln/Cross Ln junction "Hungry Corner" cos more than once now I've felt hungry as I approach it! L hamstring became tight, almost normal now. Overall, run felt like a bit of a slog, probably combination of hard bike session yesterday (increased to Level 8, a lot harder) and in bed at 4am then woken 50 mins later by that ****ing dog and again at 11am.
222
223198<<< TOTAL No. IRON MAN RUNS 1984-2021
224
225TOTYEARRK/23No. >3HRSYEARRANK/23
22651984140198412
2271219865219867
2281019878119879
22911988200198812
23061989120198912
23121990180199012
23231991160199112
23311993200199312
2348199410519941
23551996140199612
23611998200199812
2377200011120009
23812001200200112
23962002120200212
2401220035520031
2412420042520041
242920059220057
24322006180200612
2442220073420074
2453200816120089
2462720191420194
24711202070202012
2482020214420214
Iron Man Log
Cell Formulas
RangeFormula
A220:A221A220=RANK(D220,$D$2:$D$223)
E220:E221E220=D220/C220
A223A223=COUNT(A2:A222)
B223B223="<<< TOTAL No. IRON MAN RUNS 1984-" & YEAR(B221)
C225C225="RK/"& COUNT(A226:A249)
C226:C248C226=RANK(A226,$A$226:$A$248)
A248A248=COUNTA(A202:A221)
D248D248=RANK(A248,$A$226:$A$248)
F225F225="RANK/"& COUNT(A226:A249)
F226:F248F226=RANK(D226,$D$226:$D$248)
Named Ranges
NameRefers ToCells
Iron_Mans_2020='Iron Man Log'!$A$190:$A$200A223
IronManLogLastYrTot='Iron Man Log'!$A$247F225, C248:D248, C225:C247
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D226:D248Cell Valuetop 1 valuestextNO
D226:D248Cell Valuetop 2 valuestextNO
D226:D248Cell Valuetop 3 valuestextNO
A226:A248Cell Valuetop 1 valuestextNO
A226:A248Cell Valuetop 2 valuestextNO
A226:A248Cell Valuetop 3 valuestextNO
D35,D27,D29,D37,D117,D223,D7,D20,D31,D33,D40:D41,D43,D47,D49,D58,D64,D66,D74,D76,D83,D96,D121,D131,D134,D157,D161,D189,D201Cell Value>=0.1459textNO
D35,D27,D29,D37,D117,D223,D7,D20,D31,D33,D40:D41,D43,D47,D49,D58,D64,D66,D74,D76,D83,D96,D121,D131,D134,D157,D161,D189,D201Cell Valuebetween 0.125 and 0.1458textNO
D35,D27,D29,D37,D117,D223,D7,D20,D31,D33,D40:D41,D43,D47,D49,D58,D64,D66,D74,D76,D83,D96,D121,D131,D134,D157,D161,D189,D201Cell Valuebetween 0.08333333333 and 0.12495textNO
A132:A133,A75,A65,A48,A32,A190:A200,A202:A221,A162:A188,A158:A160,A135:A156,A122:A130,A97:A120,A84:A95,A77:A82,A67:A73,A59:A63,A50:A57,A44:A46,A41:A42,A34:A39,A21:A30,A8:A19,A2:A6,A223Cell Value=1textYES
A132:A133,A75,A65,A48,A32,A190:A200,A202:A221,A162:A188,A158:A160,A135:A156,A122:A130,A97:A120,A84:A95,A77:A82,A67:A73,A59:A63,A50:A57,A44:A46,A41:A42,A34:A39,A21:A30,A8:A19,A2:A6,A223Cell Value=2textYES
A132:A133,A75,A65,A48,A32,A190:A200,A202:A221,A162:A188,A158:A160,A135:A156,A122:A130,A97:A120,A84:A95,A77:A82,A67:A73,A59:A63,A50:A57,A44:A46,A41:A42,A34:A39,A21:A30,A8:A19,A2:A6,A223Cell Valuebetween 3 and 10textYES
Cells with Data Validation
CellAllowCriteria
C225Any value
F225Any value
F226:F248Whole number=454
C226:C247Whole number=454
D226:D248Whole number=123
C248Whole number=454
A226:A240Whole number=3364
A241Whole number=3364
A242:A246Whole number=3364
A247Whole number=12345
A248Whole number=12345
A223Whole number=12345
B223Whole number=546
C223:F223Whole number=11223
 
Upvote 0
That's fine
AND for future reference When reposting with XL2BB, you don't need to post everything, as we have already seen the extra info, just uncheck all the checkboxes


1631417103803.png
 
Upvote 0
Ahh - that's interesting to know, sorry, where's that options box?
 
Upvote 0
When the range is captured it should popup.
Are you using the latest version of XL2BB
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top