Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Worksheet_Change doesn't fire up when streaming live data

I have read many posts around this topic, however nothing seems to work for my scenario

I would like to Call Sub upon cell change (B2) which contains live data feed from external source -last updated:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Target.Worksheet.Range("B2")) Is Nothing Then
        Call SubName
    End If
End Sub

I went through numerous posts suggesting to check if Äpplication.EnableEvents = True, or create function to detect the change ( which does work, however I cannot call sub within function) - with no success.

Interestnigly enough, when I click on B2 and press enter - it executes the sub

Thanks

like image 838
Kiril Rusev Avatar asked Mar 13 '26 23:03

Kiril Rusev


2 Answers

Say cell A1 is updated by streaming. The update will not trigger either:

  • Worksheet_SelectionChange
  • Worksheet_Change

What you need to do is setup an equation somewhere:

=A1

When A1 is refreshed, the formula cell will re-calculate and you can detect it with the Calculate Event.

like image 105
Gary's Student Avatar answered Mar 15 '26 11:03

Gary's Student


you can simply go

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$2" Then SubName
End Sub
like image 44
user3598756 Avatar answered Mar 15 '26 11:03

user3598756



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!