Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
List Sheet & Hyperlink | Excel Discussion (Misc queries) | |||
hyperlink to sheet name where sheet names=cell content | Excel Programming | |||
Pasting hyperlink from sheet A to Sheet B? | Excel Programming | |||
Create new sheet and hyperlink to it | Excel Programming | |||
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 | Excel Programming |