VBA - SelectionChange event in Add-in

D4rwin

Board Regular
Joined
Mar 31, 2014
Messages
91
I'm trying to create a "cell tracker" whereby a user is able to select a secondary cell to follow along the movements of the activecell in order to find corresponding data points in two side-by-side tables. I have been able to do this very simply on a single workbook and sheet by adding a button which prompts the user for which cell he would like to "track" and then selecting the union and following the activecell with the SelectionChange event.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If myTog = False Then Exit Sub
    Union(ActiveCell, ActiveCell.Offset(Track_Y, Track_X)).Select
    
End Sub

However, my ultimate goal is to include this functionality in an add-in. Therefore, I am wondering if there is a way to achieve a similar result without the ability to manipulate each individual worksheet. I hope my question was clear enough.

Thanks
 
Wow, this was certainly more than I was expecting. After a little tweaking it seems to be working perfectly. Thank you both very much for going above and beyond to help a stranger in need!
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,216,119
Messages
6,128,947
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top