Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
change event
You'll need to use the Worksheet_Calculate event instead.
To detect a change in value, you'll need to save the value in a module or static variable so you can compare the old value to the current value. For instance: In a regular code module: Public vOldC38Value As Variant In the ThisWorkbook module: vOldC38Value = Sheets("Sheet1").Range("C38").Value In the worksheet code module: Private Sub Worksheet_Calculate() With Range("C38") If .Value < vOldC38Value Then vOldC38Value = .Value Macro2 End If End With End Sub In article , enyaw wrote: I have the following code that runs a macro when the cell value chages. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$C$38" Then Call Macro2 End If End Sub The problem I have that cell C38 contains a formula and will not run the macro because any change in value is not picked up. Can anyone help me? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
change event
Think this is what I am looking for. Problem is I have entries that copy to
another worksheet. Want if any entry in row is changed need code to go to copied entry and make change there also. Useing event to copy data. This valadation on change is problem. Working primilary with text in cells. trying to have multiple ifs in event code Thanks old dog new tricks "JE McGimpsey" wrote: You'll need to use the Worksheet_Calculate event instead. To detect a change in value, you'll need to save the value in a module or static variable so you can compare the old value to the current value. For instance: In a regular code module: Public vOldC38Value As Variant In the ThisWorkbook module: vOldC38Value = Sheets("Sheet1").Range("C38").Value In the worksheet code module: Private Sub Worksheet_Calculate() With Range("C38") If .Value < vOldC38Value Then vOldC38Value = .Value Macro2 End If End With End Sub In article , enyaw wrote: I have the following code that runs a macro when the cell value chages. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$C$38" Then Call Macro2 End If End Sub The problem I have that cell C38 contains a formula and will not run the macro because any change in value is not picked up. Can anyone help me? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MsgBox in Enter event causes combobox not to run Change event | Excel Programming | |||
Change event and calculate event | Excel Programming | |||
Change Cell from Validated List Not Firing Worksheet Change Event | Excel Programming | |||
change event/after update event?? | Excel Programming |