Solved

Convert Selected Cells into hyperlink using VBA

Posted on 2013-05-22
3
357 Views
Last Modified: 2013-05-23
Dear Experts:

For the currently selected cell(s) (may be just one cell selected or several) do the following running a macro:

Convert the currently selected cell(s) (Cells contain a network path such as C:\\myfolder\\etc.) ...
... into a hyperlink where the address and text to display is the same.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
Comment
Question by:AndreasHermle
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 39188231
Try this:

Sub ConvertToHyperlink()
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
        ActiveCell.Value, TextToDisplay:=ActiveCell.Value
End Sub

Open in new window


When you run it, it will make the current cell a hyperlink to the contents of the cell.
Obviously, it does not validate that the current cell is a valid path.
0
 

Author Closing Comment

by:AndreasHermle
ID: 39190973
Hi,

Great this did the trick. Thank you very much for it.

Regards, Andreas
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 39191233
Great!  Glad to help Andreas.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now