Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know of an event procedure (or code) that would enable a
piece of code to run upon the change of a particular cell on a worksheet? (I know there are event procedures for upon close, upon change, upon calculate, etc but I only want to execute a piece of code when a particular cell on my worksheet changes.). Thanks, Chet |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The events you are looking for are in the individual sheets. The Open,
Close, etc. are in ThisWorkbook. Double-click the sheet you want, e.g. "Sheet1" in the VBAProject--Microsoft Excel Objects folder. "Chet" wrote: Does anyone know of an event procedure (or code) that would enable a piece of code to run upon the change of a particular cell on a worksheet? (I know there are event procedures for upon close, upon change, upon calculate, etc but I only want to execute a piece of code when a particular cell on my worksheet changes.). Thanks, Chet |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On the sheet you want to react to the event, right click the tab and select
View Code. Just above the code window are tow drop downs. Change the one on the left to worksheet. The one on the right will now list all of the events of the sheet. Select Change. Your code should end up something like this... Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "Tada" End Sub -- HTH... Jim Thomlinson "Chet" wrote: Does anyone know of an event procedure (or code) that would enable a piece of code to run upon the change of a particular cell on a worksheet? (I know there are event procedures for upon close, upon change, upon calculate, etc but I only want to execute a piece of code when a particular cell on my worksheet changes.). Thanks, Chet |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just a heads up, but
Change < SelectionChange -- Regards, Tom Ogilvy "Jim Thomlinson" wrote: On the sheet you want to react to the event, right click the tab and select View Code. Just above the code window are tow drop downs. Change the one on the left to worksheet. The one on the right will now list all of the events of the sheet. Select Change. Your code should end up something like this... Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$A$1" Then MsgBox "Tada" End Sub -- HTH... Jim Thomlinson "Chet" wrote: Does anyone know of an event procedure (or code) that would enable a piece of code to run upon the change of a particular cell on a worksheet? (I know there are event procedures for upon close, upon change, upon calculate, etc but I only want to execute a piece of code when a particular cell on my worksheet changes.). Thanks, Chet |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK thanks. The change would be from editing the cell in question.
Thanks for the ideas..! Chet |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the change. Is the cell edited. Is it updated by a DDE formula. Is
it changed by a calculate occuring? if by editing right click on the sheet tab and select view code. then put in code like this: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Address = "$B$9" Then MsgBox "B9 has changed" End If End If End Sub http://www.cpearson.com/excel/events.htm for an overview of events. -- Regards, Tom Ogilvy "Chet" wrote: Does anyone know of an event procedure (or code) that would enable a piece of code to run upon the change of a particular cell on a worksheet? (I know there are event procedures for upon close, upon change, upon calculate, etc but I only want to execute a piece of code when a particular cell on my worksheet changes.). Thanks, Chet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation Procedure with a worksheet change event | Excel Worksheet Functions | |||
change event procedure | Excel Programming | |||
A procedure should run when one cell switch between false/true - but not with worksheet_calculate or change event... | Excel Programming | |||
change event procedure | Excel Programming | |||
Running Event Procedure When Cell Updated on Excel Worksheet | Excel Programming |