LearnMeExcel
Well-known Member
- Joined
- Aug 11, 2009
- Messages
- 746
- Office Version
- 365
- 2021
- Platform
- Windows
Hi all
this just work for one sheet not for all
should i activate every sheet before add hyperlink by
ws.activate
or what ?
Code:
Sub AddHyperLink()
Dim ws As Worksheet
For Each ws In Sheets
If ws.Name <> "Main" Then
ws.Hyperlinks.Add Anchor:=Range("a1"), Address:="", _
SubAddress:="Main!B2", TextToDisplay:="Back To Main"
End If
Next ws
End Sub
should i activate every sheet before add hyperlink by
ws.activate
or what ?