Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run some VBA code when a cell is changed?

I want to add some VBA code when the value in a cell changes.

I've already tried Worksheet_Change() as described at Contextures however, this won't work: it only fires when the user changes the value. I want to fire it whenever the value changes, i.e. whenever the spreadsheet recalculates.

Any ideas?

like image 903
Contango Avatar asked Apr 11 '26 06:04

Contango


1 Answers

Private Sub Worksheet_Calculate()
   MsgBox "Something recalculated", vbOKOnly, "Testing Actions"

End Sub
like image 99
JeffO Avatar answered Apr 13 '26 01:04

JeffO



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!