Reposition a Worksheet

DougDR

Board Regular
Joined
Jun 6, 2011
Messages
121
Hi all

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0mm 5.4pt 0mm 5.4pt; mso-para-margin:0mm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--> Really hoping that you can help. I have 2 worksheets, from the first I have a hyperlinks (one for each stock number) that jumps to a specific point (related stock info) in the second worksheet. I then have a general hyperlink in the second sheet that takes me back to the first; this link is the full column A.

But on leaving the second worksheet via the hyperlink I would like the second worksheet to reset to cell A1.

Boy I hope I have explained this right:)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
If I understand correctly, try this: right click the second sheet's tab, select View Code and paste in

Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim c As Range
Application.ScreenUpdating = False
Set c = ActiveCell
Application.Goto Me.Range("A1")
Application.Goto c
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi VoG

I did what you suggested. After linking out/back from the secound page to the first I go back to the secound using the secound worksheet tab only to find that the active cell is still the same as the one that was linked into by the first worksheet. By the way:- Thanks so much for helping!!!
 
Last edited:
Upvote 0
Hi Vog
Yes .... I see yours working ..... except I need the worksheet you are hyperlinking out of to reset to A1. If I set a hyperlink on your sheet1 to take me to say A33 in sheet2 so that A! (sheet2) is out of view then use the hyperlink out of sheet2, tab back to it the selected cell is a1 but ......... ok so I have asked for the wrong thing .... sorry I need not only cell A1 selected but also the view to be back to the top of the sheet (Sheet2 yours)
 
Upvote 0
Try

Rich (BB code):
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim c As Range
Application.ScreenUpdating = False
Set c = ActiveCell
Application.Goto Me.Range("A1"), True
Application.Goto c
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Vog ... Thank you so much ..... it works great. Boy I wish I could do that. your great thanks again ....
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,767
Members
452,940
Latest member
rootytrip

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