View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
andy the pugh andy the pugh is offline
external usenet poster
 
Posts: 12
Default macro to send you to a specified worksheet

On May 29, 11:11*am, andy the pugh wrote:
On May 28, 3:50*pm, Jack Wood
wrote:

*Then once at that specific
worksheet I have typed RTN TO INDEX & need a macro on that worksheet
when RTN TO INDEX is selected, will return you to the Index.


Perhaps put this code in the ThisWorkbook module?

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
* * If Target.Value = "RTN TO INDEX" Then
* * * * Application.Goto Sheet1.Range("A1"), True
* * End If
End Sub


Oops, that crashes with a multi-select. Use:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal
Target As Range)
If Target.Cells(1, 1).Value = "RTN TO INDEX" Then
Application.Goto Sheet1.Range("A1"), True
End If
End Sub