ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   on Calculation event (https://www.excelbanter.com/excel-programming/300059-calculation-event.html)

grievesy

on Calculation event
 
Is there such a thing as onCellupdate. I am using Worksheet_Calculate(
but my actions within that create new data and so keep looping. Is i
posible to react to just the change of data on one cell.

I am using RTD from another application and so data change often.

Please help if you can.

--
Message posted from http://www.ExcelForum.com


JE McGimpsey

on Calculation event
 
You can stop the looping by wrapping your code with
Application.Enableevents:

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
'Do stuff
Application.EnableEvents=True
End Sub



In article ,
grievesy wrote:

Is there such a thing as onCellupdate. I am using Worksheet_Calculate()
but my actions within that create new data and so keep looping. Is it
posible to react to just the change of data on one cell.

I am using RTD from another application and so data change often.

Please help if you can..


---
Message posted from http://www.ExcelForum.com/


keepITcool

on Calculation event
 


Put this in the worksheets' object codemodule:

Private Sub Worksheet_Change(ByVal Target As Range)

'this will trigger within specified range
If Target.Count = 1 And Intersect(Target, Me.Range("a30:c300")) Then
'temporarily prevent triggering further events
Application.EnableEvents = False
Target.Cells(1, 1) = Target.Cells(1, 2)
Application.EnableEvents = True
End If

End Sub


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


grievesy wrote:

Is there such a thing as onCellupdate. I am using Worksheet_Calculate

()
but my actions within that create new data and so keep looping. Is it
posible to react to just the change of data on one cell.

I am using RTD from another application and so data change often.

Please help if you can..


---
Message posted from http://www.ExcelForum.com/




grievesy[_2_]

on Calculation event
 
Thanks everyone - i now have it working.

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:45 PM.

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