Does anyone know if it's possible to trigger a macro from a cell changing value in Excel, in the same way that a formula works? Or can I write a formula that runs a macro?
event of the sheet you're working on. To do this, go to the VBA editor (ALT+F11 from within Excel) find the worksheet in the Project Explorer window, right-click it and select View Code. There will be two dropdown menus at the top of the screen. Select
you can limit which cell call you macro with the following snippet (this trapps the first 9 rows by 5 columns>:-
If ((ActiveCell.Row > 1) And (ActiveCell.Row < 9)) Then
' MsgBox ("Trapped Row " & (ActiveCell.Row))
If ((ActiveCell.Column > 1) And (ActiveCell.Column < 5)) Then
' MsgBox ("Trapped Column " & (ActiveCell.Column))
Call Sort_table
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.