ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to run an event upon changing the value of a specific cell? (https://www.excelbanter.com/excel-worksheet-functions/257075-how-run-event-upon-changing-value-specific-cell.html)

Wael Fathy

How to run an event upon changing the value of a specific cell?
 
I want to run an event or a mcaro only when a certain cell is changed.
i.e., if the cell A1 value is changed, then do such and such ...

Luke M

How to run an event upon changing the value of a specific cell?
 
Right click on your sheet tab, view code. Paste this in and modify to suit:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub

'Do something here

End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Wael Fathy" wrote:

I want to run an event or a mcaro only when a certain cell is changed.
i.e., if the cell A1 value is changed, then do such and such ...



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

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