A simple code snippet to create hyperlink on excel.
Excel hyperlink to a shared folder using UNC Path or URL.
=============================
Sub create_path()
'Add UNC Path to a Cell via VBA
Dim xPath As String
xPath = "\\myserver\myshared_folder\"
'or add a URL
'xPath = "http://www.google.com"
With Worksheets(1)
.Hyperlinks.Add Anchor:=.Range("B1"), _
Address:=xPath, _
ScreenTip:="Click to open the link", _
TextToDisplay:="Link to this path:->" & xPath
End With
End Sub
=============================
Comments
Post a Comment