On Click Goto the same value on other sheet

dixon1983

Board Regular
Joined
Apr 23, 2005
Messages
175
Hi,
Could someone please tell me the code so that when I click on a cell in Column A the cursor automatically finds the same value in another sheet and goes to it.

E.G I click on a cell in Column A that has 13456 in it, the screen automatically jumps to another sheet and finds the cell with that value in it.


Or even better would be to when you click on that cell to automatically auto filter the data in the other sheet to for whatever value is clicked on originally. This would be fantastic if it could be achieved.

Thanks in advance for any help you provide on this.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,461
Office Version
  1. 365
Platform
  1. Windows
dixon1983

See if this is what you want. Assumptions are:
1. Original sheet where you will click is called 'Sheet A'
2. Other sheet that will be filtered is called 'Sheet B"
3. The column on Sheet B to be filtered is also column A.

The following code is the Worksheet_SelectionChange event in 'Sheet A'

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_SelectionChange(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range)
    <SPAN style="color:#00007F">Dim</SPAN> FilterCriteria <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN>
    
    <SPAN style="color:#00007F">If</SPAN> Selection.Count > 1 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
    <SPAN style="color:#00007F">If</SPAN> Selection.Column <> 1 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
    FilterCriteria = Selection.Value
    Worksheets("Sheet B").Activate
    <SPAN style="color:#00007F">With</SPAN> ActiveSheet.Columns("A")
        .AutoFilter Field:=1, Criteria1:=FilterCriteria
    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 

Forum statistics

Threads
1,136,878
Messages
5,678,302
Members
419,753
Latest member
Sallylwy

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
Top