Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
can you please show me how to run a macro after a change a cell
thank you in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
Right click on the tab of the sheet that you would like to react to a change.
Select View Code. Thiw will open up the VB editor. Just above the code window is a drop down list that will say General. Switch it to Worksheet. When you do this a procedure will be added to the code window that is on selection change (not what you want so just delete it). Jut to the right of the drop down that now says worksheet is a drop down. Select change. A change procedure has now been added similar to Private Sub Worksheet_Change(ByVal Target As Range) End Sub Add a message box to it something like this... Private Sub Worksheet_Change(ByVal Target As Range) msgbox "You changed " & target.address & " to " & target.value End Sub -- HTH... Jim Thomlinson "rafik" wrote: can you please show me how to run a macro after a change a cell thank you in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
The macro below will run each time a value is changed by the user in any
sheet.Let me know if this what you want.Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range) ' runs when a sheet is changed End Sub"rafik" wrote in message ... can you please show me how to run a macro after a change a cell thank you in advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
"Richard Mertl" wrote: The macro below will run each time a value is changed by the user in any sheet.Let me know if this what you want.Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range) ' runs when a sheet is changed End Sub"rafik" wrote in message ... can you please show me how to run a macro after a change a cell thank you in advance |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
"Richard Mertl" wrote: The macro below will run each time a value is changed by the user in any sheet.Let me know if this what you want.Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range) ' runs when a sheet is changed End Sub"rafik" wrote in message ... can you please show me how to run a macro after a change a cell thank you in advance thank you it worked but the macro runs for all the cells can we make it specific to one cell or a range thank you in advance |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell On change
Target is the cell that changed. To run lony for specific cells or ranges you
need to use an if statement, similar to If target.address = "$A$1" then 'do your stuff end if For a range you need to use the intersect function if not intersect(target, range("A1:B10")) is nothing then 'Do your stuff end if -- HTH... Jim Thomlinson "rafik" wrote: "Richard Mertl" wrote: The macro below will run each time a value is changed by the user in any sheet.Let me know if this what you want.Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range) ' runs when a sheet is changed End Sub"rafik" wrote in message ... can you please show me how to run a macro after a change a cell thank you in advance thank you it worked but the macro runs for all the cells can we make it specific to one cell or a range thank you in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change cell contents when pull down menu choices change | Excel Worksheet Functions | |||
making copied cells change with change in original cell | Excel Worksheet Functions | |||
excel deleting rows last cell does not change. How to change? | Excel Discussion (Misc queries) | |||
Change workbook sheet reference using cell A1 to change a vairable | Excel Worksheet Functions | |||
Change Cell from Validated List Not Firing Worksheet Change Event | Excel Programming |