ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculate Change (https://www.excelbanter.com/excel-programming/418655-calculate-change.html)

Macro not running as intended[_2_]

Calculate Change
 
I am trying to run a macro that will fire after a cell is calculated and
reaches a certain level. Where can I look for assistance in writing this
code? I'm pretty new to this and not really sure where to begin.

Mike H

Calculate Change
 
Hi,

Use the worksheet_calculate event

Private Sub Worksheet_Calculate()
If Range("A1").Value = 999 Then
'Do all manner of things in VB
End If
End Sub

Mike

"Macro not running as intended" wrote:

I am trying to run a macro that will fire after a cell is calculated and
reaches a certain level. Where can I look for assistance in writing this
code? I'm pretty new to this and not really sure where to begin.


joel

Calculate Change
 
You can use a calculate event wehich occurs every time a worksheet is
reculated

Private Sub Worksheet_Calculate()

If Range("C4").Value = 10 Then
'enter your code here
End If

End Sub

Add code to the VBA sheet corresponding to the cell which you are
monitoring. don't use a VBA module sheet.

"Macro not running as intended" wrote:

I am trying to run a macro that will fire after a cell is calculated and
reaches a certain level. Where can I look for assistance in writing this
code? I'm pretty new to this and not really sure where to begin.



All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com