How can I create a hyperlink using VBA and Windows navigation?
I would like to create a hyperlink, say in cell A1, by running a macro that opens a Windows navigation panel.
In principle it would be exactly like right clicking a cell and clicking the hyperlink option.
I would like the macro to specify the cell that the hyperlink would be added to.
VBAMicrosoft ExcelMicrosoft Office
Last Comment
Shums Faruk
8/22/2022 - Mon
Shums Faruk
Hi,
Something like this:
Sub CreateHyperLink()Dim Ws As WorksheetDim Rng As RangeSet Ws = Worksheets("Sheet1")Set Rng = Ws.Range("A1")Rng.Parent.Hyperlinks.Add Anchor:=Rng, Address:="", SubAddress:="Sheet1!A5", TextToDisplay:="Click Here to go to A5" With Rng.Font .ColorIndex = xlAutomatic .Underline = xlUnderlineStyleNone End With With Rng.Characters(Start:=21, Length:=2).Font .Underline = xlUnderlineStyleSingle .Color = -4165632 End WithEnd Sub
Thanks Shuns. I can see that will add a hyperlink according to the hard coding. However I want to click on a button ...open a navigation pane ...navigate to a file click on the file and create a link in a cell designated by the code.
spar-kle
ASKER
Sorry "Shums"
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Something like this:
Open in new window
It will create hyperlink in Cell A1 of Sheet1 to go to Cell A5