Tab code? When tab is selected, goto cell A1

nhbartos

Board Regular
Joined
May 23, 2015
Messages
148
Hi folks...
Got one for you...

Tabs.
I hate that all my tabs are scrolled to different locations within the data tables. They are on page 1, 2, 3, up, down, left...right...well you know.
I would like to know if I could code the tab to, when selected, go to a specific point or cell location...maybe a macro that runs when the file is opened or refreshed?

I have +/- 100 tabs and want each one to go to Cell D14 whenever it is selected or clicked on.
I would like every tab to automatically, when I click on it, to scroll to the top and place the cursor in cell D11.
A locked starting point maybe?


Get me?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,144
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
This goes in a Thisworkbook module.
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Range("D11").Select
End Sub
 
Upvote 0

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
19,353
Office Version
  1. 2021
Platform
  1. Windows
You Quote:
I have +/- 100 tabs and want each one to go to Cell D14
I would like every tab to automatically, when I click on it, to scroll to the top and place the cursor in cell D11.
Do you want to go to D14 or D11
 
Upvote 0

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
18,144
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Not working...
How/where did you install the code? Do you know what a Thisworkbook module is?

"Not working" is NOT very informative - what exactly happens when you activate a worksheet?
 
Upvote 0

Forum statistics

Threads
1,196,007
Messages
6,012,829
Members
441,732
Latest member
Ayon

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