Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when updating a cell
I want to run a Macro when the contents of a cell are changed. I am familiar
with running a macro when updating a worksheet or when clicking a button but can not find the right event for running one when only a cell has changed. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when updating a cell
|
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when updating a cell
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:H10" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target 'do your stuff End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "Jim Hartley" <Jim wrote in message ... I want to run a Macro when the contents of a cell are changed. I am familiar with running a macro when updating a worksheet or when clicking a button but can not find the right event for running one when only a cell has changed. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automation Macro for updating formula when changing cell value | Excel Discussion (Misc queries) | |||
Automation Macro for updating formula when changing cell value | Excel Discussion (Misc queries) | |||
Regarding auto updating Macro | Excel Discussion (Misc queries) | |||
Macro for updating workbooks | Excel Programming | |||
Updating Cells that Get Value from Macro | Excel Programming |