View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Worksheet Navigation

First, in ThisWorkbook's code module, put in this event procedu

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target
As Hyperlink)
Set LinkBack = Target.Range
End Sub

LinkBack is a Global variable defined in a separate code module:
Public LinkBack as Range

Finally, the code for the buttons would be like this:
Sub Button1_Click()
LinkBack.Parent.Activate ' to activate the source sheet
LinkBack.Activate ' to activate the source range
End Sub

"subseaguy" wrote:

I have a workbook with 12 worksheets. I want to be able to hyperlink from
one worksheet to another, then use a command button to return to the previous
button (i.e. fire HL on WS1 which goes to specific location on WS2, then fire
a macro via command button to return to original location in WS1). Not sure
how to do this. Can you pass variables to/from PSubs in the same module?