Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Hyperlink sheet name to its corresponding sheet

Dear All

I got all sheets name in my workbook by this code
Sub GetSheetNames()

Dim i As Integer
Dim SheetName()
sheetcount = Application.Worksheets.Count
ReDim SheetName(1 To sheetcount)
For i = 1 To sheetcount
Cells(i, 1) = Sheets(i).Name
Next

End Sub

I want that when I got all the sheet names a code make hyperlink to its
corresponding sheet

Thanks in advance :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Hyperlink sheet name to its corresponding sheet

Try this

Option Explicit

Sub GetSheetNames()

Dim WS As Excel.Worksheet
Dim aWS As Excel.Worksheet
Dim lRow As Long
lRow = 0
Set aWS = ThisWorkbook.ActiveSheet
For Each WS In ThisWorkbook.Worksheets
lRow = lRow + 1
aWS.Hyperlinks.Add Anchor:=aWS.Cells(lRow, 1), Address:="", SubAddress:= _
"'" & WS.Name & "'!A1", TextToDisplay:=WS.Name

Next WS

End Sub


"Abdul Shakeel" wrote:

Dear All

I got all sheets name in my workbook by this code
Sub GetSheetNames()

Dim i As Integer
Dim SheetName()
sheetcount = Application.Worksheets.Count
ReDim SheetName(1 To sheetcount)
For i = 1 To sheetcount
Cells(i, 1) = Sheets(i).Name
Next

End Sub

I want that when I got all the sheet names a code make hyperlink to its
corresponding sheet

Thanks in advance :)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List Sheet & Hyperlink Dolphinv4 Excel Discussion (Misc queries) 1 January 3rd 08 10:37 AM
hyperlink to sheet name where sheet names=cell content Banzai Excel Programming 1 August 6th 07 12:46 PM
Pasting hyperlink from sheet A to Sheet B? Chet Excel Programming 4 March 13th 07 07:28 PM
Create new sheet and hyperlink to it RealmSteel Excel Programming 1 December 5th 06 02:50 AM
Inserting a row in sheet A should Insert a row in sheet B, removing a row in Sheet A should remove the corresponding row in sheet B Hannes Heckner Excel Programming 1 March 5th 04 09:10 AM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"