So just a couple of things you should know about the code.
I changed it so that as you add employees it will automatically adjust. This code assumes your employees are in column A and that the area below the employees in col A is clear all the way to the bottom of the sheet, no other data. It also assumes the employees start in row 5 as they do on your sample sheet. It's obvious where to change that if you move the first employee to a different row.
So 5 is the starting row, the code checks for the last row with data in it in col A to decide where to stop that is the variable you see as lr.
Here is that code. Also notice the worksheet name, change it to suit your actual sheet name, the quotes need to stay around the name. These are two separate lines is the code, I'm just drawing your attention to these lines. The code looks to see if the columns you selected intersect with any employee rows, so selecting data not on an employee row won't yield any results.
The code now looks for any six consecutive blank spaces within your selection. The counter starts at zero and adds 1 for each blank cell it finds. It resets every time it finds a cell that is not blank. If it reaches 6 it just moves to the next employee and you will not get a message box unless it actually finishes all selected cells for a given employee and hasn't reached 6, it may have reached 5 and then reset but since it never got to 6 you will now get a message. Bottom line 6 blank cells in a row anywhere in each row you selected and you get no message.
Bookmarks