简体   繁体   中英

Running a code in Excel VBA whenever a cell with RTD-function is updated

I use VBA in MS Excel 2007 and I have cells with RTD-function that are updated every minute. My code is running just fine, but despite searching for an answer, I have not figured out how to make the code loop whenever new data are introduced in the RTD cells. Is there any simple answer to this question?

In Excel VBA there is an event called Worksheet_Change . This event is fired when a cell value is changed. I think this event is what you need.

Private Sub Worksheet_Change(ByVal Target As Range)
 'write your code here (Target is the cell)
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM