Solved

Convert Selected Cells into hyperlink using VBA

Posted on 2013-05-22
3
388 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

808 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