24. VBA Macro Code to Create Table of Contents with Hyperlinks

Опубликовано: 12 Октябрь 2024
на канале: Learn Excel VBA
781
10

In this video, you will learn how to Create Table of Contents with Hyperlinks with the help of VBA Macro Code.

Sub Getting_Worksheets_Names()

For i = 1 To ThisWorkbook.Worksheets.Count
Sheet16.Range("b" & i + 3).Value = Sheets(i).Name
Sheet16.Range("b" & i + 3).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, _
Address:="", SubAddress:=Range("b" & i + 3).Value & "!A1"
Next i

End Sub