RE: Display an Alert popup.

Tech-Archive recommends: Fix windows errors by optimizing your registry

Xluser_at_work
Date: 08/24/04


Date: Tue, 24 Aug 2004 05:55:01 -0700

Thanks Alex.

However, rather than the alert when the user simply goes into the cell, I
want it to display the alert if they choose a particular option from the list
and to do nothing if they choose any other cell.

Are you able to help with this?

Matthew

"Alex Guardiet" wrote:

> Hi,
>
> The code is quite simple, but placing the code in the right place will be
> more complicated if you're not used to VBA. Let's start with the code:
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> If Target.Address = "$D$1" Then MsgBox ("cell selection")
> End Sub
>
> I'm assuming you want the message to appear when the user selects a specific
> cell. You have to replace the "$D$1" bit for the cell that will trigger the
> event. In my example code the event occurs when the user selects cell D1
> (replace the D and the 1 but leave the dollar signs in).
> Now for the placing of the code: Go to the Visual Basic Editor (Tools >
> Macros > Visual Basic Editor), then select the *** where you have your data
> (where the event will happen) from the Project window (on the upper left-hand
> side). It is important that you select the correct *** and that you double
> click to make sure you have selected it. Then simply paste the code. It
> should work.
>
> Regards,
>
> Alex
>
> "Xluser@work" wrote:
>
> > Please can someone assist with the following?
> >
> > At present I have a data validation list in Excel (which is working fine).
> > However, when a user selects one of the options in the list I need Excel to
> > show a popup with a warning message (as this option in the list works
> > differently to the others). How can I make Excel do this? I can make a popup
> > in Excel using datavalidation but since this cell already has this (for the
> > list) how can I replicate again?
> >
> > Any help gratefully received.
> >
> > TIA.


Quantcast