Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like a VBA macro to run after one cell has been updated or changed and only that one cell. I've been able to write an Event Handler for the worksheet change. The the macro runs great, but it runs all the time. I just want to run it when a single cell on the spreadsheet is changed.
Thanks in advance for any help, David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in the worksheet_change event, you would test what cell triggered the event
and jump out if it isn't the cell of interest at the top, add a line like: if target.Address < "$F$4" then exit sub so the event always fires, but it doesn't do anything unless it is the cell you want to react to. -- Regards, Tom Ogilvy David wrote in message ... I would like a VBA macro to run after one cell has been updated or changed and only that one cell. I've been able to write an Event Handler for the worksheet change. The the macro runs great, but it runs all the time. I just want to run it when a single cell on the spreadsheet is changed. Thanks in advance for any help, David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi David
Try this for A1 Private Sub Worksheet_Change(ByVal Target As Range) If Not Application.Intersect(Range("A1"), Target) Is Nothing Then MsgBox "You changed A1" End If End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "David" wrote in message ... I would like a VBA macro to run after one cell has been updated or changed and only that one cell. I've been able to write an Event Handler for the worksheet change. The the macro runs great, but it runs all the time. I just want to run it when a single cell on the spreadsheet is changed. Thanks in advance for any help, David |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help. The code works great!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet_change event handler error | Excel Discussion (Misc queries) | |||
What code do I use to attach event handler that will open my user. | Excel Worksheet Functions | |||
error handler | Excel Programming | |||
Re : Excel event handler Worksheet_SelectionChange | Excel Programming | |||
Re : Excel event handler Worksheet_SelectionChange | Excel Programming |