View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default message box popping up when the selection of a Form combo box

Hi George,

I wonder what the problem is. Maybe different versions of Excel or maybe we
are on a different wave length.
What version of Excel are you running?
Do you already have a macro assigned to the combo box? If so, the code I
have given you will have to be integrated into it.
Do you understand then you can't stop the change taking place when you click
on an alternative name, you can only handle the change and revert to the
original if answer to question is no?

The code appears to work fine in version 2002. It should not run if you
simply click on the combo box. It should only run if you make a change to the
selection in the combo box and you then you have to answer Yes or No to the
question. If Yes, the change is allowed. If No, then the change not allowed
and it reverts to the previous selection.

I have assumed that you know how to copy the macro into the module via the
VBA editor and assign it to the combo box. If not then let me know and I'll
give you further instructions. If you copy it into the module, you can change
the sub name to anything you like but you have to right click on the combo
box and assign the combo box to the particular macro.

Regards,

OssieMac

"George" wrote:

Hi, OssieMac:

You are exactly right.

Firstly, the combo box was one created from the Forms Tool bar and not
one created from the Control Tool Box toolbar.
Secondly, I already set the combo box to be linked to cell B1 (index
of the selection from the combo box).
Finally, whenever I change the selection from the combo box, I just
want a WARNING message popping up and the response to the message is
always "ok". In other words, if I click the combo box but I don't
change the PREVIOUS selection, I DON'T need the message box.

If you can modify your code, it will be great. Your efforts are highly
appreciated!

Thanks again,