How can I make Excel give me a warning message?

R

Ray

I am working on an Excel spreadsheet in which I will type in an
employee number, when scheduling them for the forthcoming work week.
When I type in their employee number, Excel puts their name into a
box, scheduling them for work that day, if they are available for
work. Excel, using VLOOKUP, searches through an array of data, until
it finds the row containing the employee's number, then it goes across
the row to the specified column ("Mon.," "Tue.," etc.), and returns
the textual information found in that cell to a "warning box." The
returned information might be "Vacation," "Regular Day Off," "After
3," etc,, or it might just be blank. If it is blank, then I can go
ahead and schedule that person for that particular day, and the
"warning" box will remain blank. On the other hand, if Excel returns
"Vacation," "Off," etc., then, of course, that tells me I cannot
schedule that person for that day. In that case, no problem, I just
delete the employee number, the warning box returns to being empty,
and everything's fine. Pretty straight forward, and it works fines.
So far, so good.

But, here's the problem/question: If Excel tells me the employee can
work that day, but can't come in until, say, after 3:00, it will
return "After 3" in the warning box. Now, I'm stuck. I need to be able
to delete that message ("After 3") from the warning box, but I can't
do it by deleting the employee's number. I need to keep the
employee's number and name, because they can work that day. If I were
to go back and delete their employee number, then Excel would take
their name off the sheet, and they would not be scheduled for work
that day. So, here's the question: is there a way to delete/clear/
remove the textual contents of that "warning" box, without altering
the formula it contains? If I just right click on the "warning" box,
then select "Clear Contents," the formula that was in that box is now
gone, too. How can you remove the contents of a cell, without
altering the formula the cell contains, which would mess up my
spreadsheet?

Any help would be greatly appreciated.

Ray
 
G

Guest

I don't think that's possible without destroying the formula. How about
deleting the information in the lookup table?
 
R

Ray

I don't think that's possible without destroying the formula. How about
deleting the information in the lookup table?








- Show quoted text -

Thanks for your time and input. No, I need to have that lookup table
untouched, as it contains a "master" list of who is off, who has
vacations, who is coming in after 4:00, etc., and it is can't be
altered in any way. It seems like I'm stuck, doesn't it?
 
K

Keith R

Ray-

I'd suggest using an IF statement in your box that brings across the
warning, and introduce one additional column
A B C
1 ID Warning Flag
2

The Flag column would be blank; in the warning column adapt your existing
formula as (air formula)
=if(length(C2)=0,[existing formula],"")

Then if you want to leave the EmployeeID visible and remove the message, you
can just throw a space (or any char) in the flag column (C in my example) to
hide the warning.

This solution is a worksheet formula rather than programming; if you need
help with a programming solution please take a shot at it and post your code
when you get stuck. If you want to pursue the worksheet formula approach,
I'd suggest posting any followups to the
microsoft.public.excel.worksheet.functions

Good luck,
Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top