ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Coverting hyperlink cell to the web page address (https://www.excelbanter.com/excel-discussion-misc-queries/164787-coverting-hyperlink-cell-web-page-address.html)

Roger on Excel

Coverting hyperlink cell to the web page address
 
I have multiple hyperlinks in a document with the same name "safety
document". each calls up the webpage of the associated chemical from the
internet.

I want to convert these links to the actual web address so that I may call
up these addresses using hyperlink(vlookup etc).

Can someone help?

Kevin B

Coverting hyperlink cell to the web page address
 
Make a back up of your file and test drive this in the spare file...

Press Alt+F11 to display the VBE and then click INSERT in the menu and
select MODULE.

Paste the following sub in the new module:

Sub ShowHLink()

Dim ws As Worksheet
Dim h As Hyperlink
Dim strHLink As String

Set ws = ThisWorkbook.Sheets(1)

For Each h In ws.Hyperlinks
h.TextToDisplay = h.Address
Next h

Set ws = Nothing
Set h = Nothing

End Sub

--
Kevin Backmann


"Roger on Excel" wrote:

I have multiple hyperlinks in a document with the same name "safety
document". each calls up the webpage of the associated chemical from the
internet.

I want to convert these links to the actual web address so that I may call
up these addresses using hyperlink(vlookup etc).

Can someone help?


Kevin B

Coverting hyperlink cell to the web page address
 
I forgot to add the steps to running the macro:

Click TOOLS on the menu
Click MACRO on the drop-down menu
Click MACROS on the cascade menu
Select the macro named ShowHLink
Click the RUN command button


--
Kevin Backmann


"Kevin B" wrote:

Make a back up of your file and test drive this in the spare file...

Press Alt+F11 to display the VBE and then click INSERT in the menu and
select MODULE.

Paste the following sub in the new module:

Sub ShowHLink()

Dim ws As Worksheet
Dim h As Hyperlink
Dim strHLink As String

Set ws = ThisWorkbook.Sheets(1)

For Each h In ws.Hyperlinks
h.TextToDisplay = h.Address
Next h

Set ws = Nothing
Set h = Nothing

End Sub

--
Kevin Backmann


"Roger on Excel" wrote:

I have multiple hyperlinks in a document with the same name "safety
document". each calls up the webpage of the associated chemical from the
internet.

I want to convert these links to the actual web address so that I may call
up these addresses using hyperlink(vlookup etc).

Can someone help?



All times are GMT +1. The time now is 04:27 PM.

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