ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trigger an event when a cell's value is changed. (https://www.excelbanter.com/excel-programming/306891-trigger-event-when-cells-value-changed.html)

Prasad Vanka

Trigger an event when a cell's value is changed.
 
Hi,

I have a cell which I am using as a listbox (Went into the Data menu
and selected Data Validation. Then for Validations Criteria under the
Settings tab, I selected list for the Allow: property). This cell can
only take values 1, 2, 3 or 4. That is the user can select a value
between 1 to 4 from the list box.

Now my question:
Is there any way I can trap the event when the value of this cell
changes. For example if the user changes the value from 1 to 2 then I
want to execute a macro. If it is not possible then can someone
suggest me an alternative and also some piece of code.

Your help is much appreciated.

Thanks & Regards,
Prasad Vanka

Frank Kabel

Trigger an event when a cell's value is changed.
 
Hi
see:
http://www.cpearson.com/excel/events.htm

use the workshee_change event for this

--
Regards
Frank Kabel
Frankfurt, Germany

"Prasad Vanka" schrieb im
Newsbeitrag m...
Hi,

I have a cell which I am using as a listbox (Went into the Data menu
and selected Data Validation. Then for Validations Criteria under the
Settings tab, I selected list for the Allow: property). This cell can
only take values 1, 2, 3 or 4. That is the user can select a value
between 1 to 4 from the list box.

Now my question:
Is there any way I can trap the event when the value of this cell
changes. For example if the user changes the value from 1 to 2 then I
want to execute a macro. If it is not possible then can someone
suggest me an alternative and also some piece of code.

Your help is much appreciated.

Thanks & Regards,
Prasad Vanka



Neil[_14_]

Trigger an event when a cell's value is changed.
 
I put a textbox on the worksheet, set as hidden, and link
the value of the textbox to the cell in question, then
put the code against the change event for the textbox,
probably a really poor way to do it, but hey it works for
me !!!


-----Original Message-----
Hi,

I have a cell which I am using as a listbox (Went into

the Data menu
and selected Data Validation. Then for Validations

Criteria under the
Settings tab, I selected list for the Allow: property).

This cell can
only take values 1, 2, 3 or 4. That is the user can

select a value
between 1 to 4 from the list box.

Now my question:
Is there any way I can trap the event when the value of

this cell
changes. For example if the user changes the value from

1 to 2 then I
want to execute a macro. If it is not possible then can

someone
suggest me an alternative and also some piece of code.

Your help is much appreciated.

Thanks & Regards,
Prasad Vanka
.


Frank Kabel

Trigger an event when a cell's value is changed.
 
Hi
the worksheet_change event is ONLY triggered if you change a VALUE. So
just selecting the dropdown and not changing the current cell value
will NOT trigger this event (and that is what is to be expected).

Note: In Excel 97 the worksheet_change event is not triggered then the
cell is changed by a drop-down listbox from 'Data - Validation'. In
these cases use a different cell referencing this dropdown cell and use
the worksheet_calculate event

--
Regards
Frank Kabel
Frankfurt, Germany

"Freddo Frog" <Freddo schrieb im
Newsbeitrag ...
I had this same problem and tried the worksheet_change event but it

didn't
work.

The worksheet_change event only seems to work when the cell selection
actually changes but if you click the list's dropdown arrow you

haven't
actually selected another cell so the event isn't trigger.

I'm using Excel 2000 if that makes a difference.

"Frank Kabel" wrote:

Hi
see:
http://www.cpearson.com/excel/events.htm

use the workshee_change event for this

--
Regards
Frank Kabel
Frankfurt, Germany

"Prasad Vanka" schrieb im
Newsbeitrag m...
Hi,

I have a cell which I am using as a listbox (Went into the Data

menu
and selected Data Validation. Then for Validations Criteria under

the
Settings tab, I selected list for the Allow: property). This cell

can
only take values 1, 2, 3 or 4. That is the user can select a

value
between 1 to 4 from the list box.

Now my question:
Is there any way I can trap the event when the value of this cell
changes. For example if the user changes the value from 1 to 2

then I
want to execute a macro. If it is not possible then can someone
suggest me an alternative and also some piece of code.

Your help is much appreciated.

Thanks & Regards,
Prasad Vanka






All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com