Warning Message Pop-Up Box

Chris Waller

Board Regular
Joined
Jan 18, 2009
Messages
183
Office Version
  1. 365
Platform
  1. Windows
I have an Excel 2010 Spreadsheet. In Column A I have a list of names and in column B I have a list of dates. I would like to know if it is possible to create a pop-up box that will inform me if any of the names in Column A have worked on a Saturday, Sunday or any Bank Holidays. Column A is titled Name of Individual and Column B is titled Date of Activity.

I would like a pop-up box that will say something like:-

Fred Bloggs worked on Monday the 1st of January 2016 which is a Bank Holiday.
Fred Bloggs worked on Saturday the 30th December 2015. etc

I would ideally like this to be in VBA as I receive a large number of files containing similar data on a monthly basis. TIA
 
Also I should mention, a message box is limited to 1024 characters. From test this gives approx. 24 lines (24 people worked a weekend or BH) in the message box, would you ever expect to see more than this?
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Alan,

I would be very surprised to see more than a couple of people working more than one or two Saturday's in the month and I have not yet come across anyone working a Bank Holiday, but that doesn't mean that it won't happen. But this is just a way of capturing anything that I may visually miss.
 
Upvote 0
Alan,

I tried this again, at home and I removed all the weekends and Bank Holidays an a Blank pop-up box appeared. Is it possible to input a phrase like "No weekends or Bank Holidays worked in this period"? I have tried several ways of doing this, but I haven't got it to work as yet.

Thanks

Chris
 
Upvote 0
Hi Chris,

yes, add this just before "MsgBox (MsgTxt)"

Code:
If MsgTxt = "" then 
[COLOR=#333333]    MsgTxt = "No weekends or Bank Holidays Worked"
[/COLOR]end if

Cheers,
Alan.
 
Last edited:
Upvote 0
Hi Chris,

yes, add this just before "MsgBox (MsgTxt)"

Code:
If MsgTxt = "" then 
[COLOR=#333333]    MsgTxt = "No weekends or Bank Holidays Worked"
[/COLOR]end if

Cheers,
Alan.

Alan.

Thanks once again. I had forgotten to add If MsgTxt = "" Then before the line of text I had added i.e. MsgText = etc.

Thanks again for your help. You have made me very happy helping in this way.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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