ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Change from Add-In (https://www.excelbanter.com/excel-programming/404507-worksheet-change-add.html)

Scott

Worksheet Change from Add-In
 
I have the below code behind "Sheet1". I have an add-in that loads whenever
this particular workbook opens and I always try to keep my code within the
..xla add-in file.

Because one of my needs for this workbook is to take action if the values
change in A:2 or B:2, I have the code below in the "Sheet1" Worksheet_Change
sub.

Is there any code that could be used in the add-in that would achieve the
same task of monitoring cells A2 and B2 for change, but reside in the .xla
add-in instead of in the Worksheet_Change sub within "Sheet1"?

CODE:

Private Sub Worksheet_Change(ByVal Target As Range)


Select Case Target.Address

Case Is = "$A$2"
' Do something ...
Case Is = "$B$2"
' Do something ...

End Select

End Sub




All times are GMT +1. The time now is 03:51 AM.

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