ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Activating hyperlinks (https://www.excelbanter.com/excel-discussion-misc-queries/450165-activating-hyperlinks.html)

[email protected]

Activating hyperlinks
 
In Excel 2010, I have a range of cells into which I have copied and
pasted URLs. They all pasted as text and I want them to be active
hyperlinks.

I can activate them one at a time by simply positioning the cursor at
the end of the URL and pressing Enter but I want to activate them all
at once.

I tried:

- Select the range of cells
- Right click
- Click Hyperlink
- Select "Link to: Existing File or Web Page"
- Select "Look In: Browse the Web"

That simply opens my browser.

How can I activate the whole range at once?


Dick Evans

Claus Busch

Activating hyperlinks
 
hi,

Am Tue, 17 Jun 2014 14:40:54 -0400 schrieb :

In Excel 2010, I have a range of cells into which I have copied and
pasted URLs. They all pasted as text and I want them to be active
hyperlinks.


try (if your strings are not in column A then modify the code):

Sub ActivateHyperlinks()
Dim rngC As Range
Dim LRow As Long

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In .Range("A1:A" & LRow)
.Hyperlinks.Add _
anchor:=rngC, _
Address:=IIf(Left(rngC.Text, 4) < "http", _
"http://" & rngC.Text, rngC.Text)
Next
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

[email protected]

Activating hyperlinks
 
On Tue, 17 Jun 2014 20:59:46 +0200, Claus Busch
wrote:

hi,

Am Tue, 17 Jun 2014 14:40:54 -0400 schrieb :

In Excel 2010, I have a range of cells into which I have copied and
pasted URLs. They all pasted as text and I want them to be active
hyperlinks.


try (if your strings are not in column A then modify the code):


Sorry, I'm not writing a macro, I'm just looking for a way to click my
way to my goal.


Sub ActivateHyperlinks()
Dim rngC As Range
Dim LRow As Long

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In .Range("A1:A" & LRow)
.Hyperlinks.Add _
anchor:=rngC, _
Address:=IIf(Left(rngC.Text, 4) < "http", _
"http://" & rngC.Text, rngC.Text)
Next
End With
End Sub


Regards
Claus B.


[email protected]

Activating hyperlinks
 
On Tue, 17 Jun 2014 14:40:54 -0400, wrote:

In Excel 2010, I have a range of cells into which I have copied and
pasted URLs. They all pasted as text and I want them to be active
hyperlinks.

I can activate them one at a time by simply positioning the cursor at
the end of the URL and pressing Enter but I want to activate them all
at once.

I tried:

- Select the range of cells
- Right click
- Click Hyperlink
- Select "Link to: Existing File or Web Page"
- Select "Look In: Browse the Web"

That simply opens my browser.

How can I activate the whole range at once?



For future reference:

- Select the target cells.
- Home Styles Cell Styles Hyperlink

Easy peasy.


All times are GMT +1. The time now is 07:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com