Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I start a macro whenever the contents in a cell is added or changed?
Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
use the worksheet change event right click the sheet tab and from the popup select view code which will bring up the vb editor in the left combo box above the code window, select worksheet. put your code there. it will fire whenever data changes on the sheet. regards FSt1 "ranswert" wrote: How do I start a macro whenever the contents in a cell is added or changed? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10" '<== change to suit On Error GoTo ws_exit Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Call your_macro 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 Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "ranswert" wrote in message ... How do I start a macro whenever the contents in a cell is added or changed? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi ranswert
You can use the change event in the sheet module "YourMacroName" is the name of your sub Private Sub Worksheet_Change(ByVal Target As Range) Call YourMacroName End Sub See this page also if you have no idea where to paste this http://www.rondebruin.nl/code.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "ranswert" wrote in message ... How do I start a macro whenever the contents in a cell is added or changed? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to run the macro only when a certain cell is changed not the
whole sheet? "FSt1" wrote: hi use the worksheet change event right click the sheet tab and from the popup select view code which will bring up the vb editor in the left combo box above the code window, select worksheet. put your code there. it will fire whenever data changes on the sheet. regards FSt1 "ranswert" wrote: How do I start a macro whenever the contents in a cell is added or changed? Thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
yes there is. bob just posted a solution. regards FSt1 "ranswert" wrote: Is there a way to run the macro only when a certain cell is changed not the whole sheet? "FSt1" wrote: hi use the worksheet change event right click the sheet tab and from the popup select view code which will bring up the vb editor in the left combo box above the code window, select worksheet. put your code there. it will fire whenever data changes on the sheet. regards FSt1 "ranswert" wrote: How do I start a macro whenever the contents in a cell is added or changed? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sub Macro vrs Function Macro Auto Start | Excel Discussion (Misc queries) | |||
How to start a Macro | Excel Discussion (Misc queries) | |||
Macro Start | Excel Discussion (Misc queries) | |||
start a macro | Excel Worksheet Functions | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |