macro to select worksheet

K

kalpesh

Hello

my workbook contain many workshee

i want to create a macro in sheet1 to select other workshee

e.g

when click command button go to the worksheet

how possible it
 
I

isabelle

hi,

you can use a hyperlink


Sub Macro1()
For i = 2 To Sheets.Count
Sheets(1).Hyperlinks.Add Anchor:=Range("A" & i), _
Address:="", SubAddress:=Sheets(i).Name & "!A1", TextToDisplay:=Sheets(i).Name & "!A1"
Next
End Sub



--
isabelle



Le 2012-02-15 12:01, kalpesh a écrit :
 
D

Don Guillett

or one I have used from a name of the sheet in a cell. You can do a
macro to list the sheets, if desired.
'
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Application.DisplayAlerts = False
Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(WantedSheet) Is Nothing Then
GetWorkbook ' calls another macro to do that
Else
Application.GoTo Sheets(WantedSheet).Range("a4")
End If
Application.DisplayAlerts = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top