VBA Macro Create Hyperlink out of Cell Value contents

Lres81715

Board Regular
Joined
Aug 26, 2015
Messages
147
Hello All,

I'm trying to create a series of Macros that take the contents of Column E, puts a direct hyperlink to website in question.
I just can't seem to find the code online to help me achieve what I want.

This is the code I have so far.
Code:
    Dim sh1         As Worksheet
    Dim LastRow     As Long
    Dim c           As Range
    Dim hlink       As String
    
    Set sh1 = Sheets("Sheet1")
    LastRow = sh1.Cells.Find("*", , xlFormulas, xlPart, xlByRows, xlPrevious).Row


    For Each c In Intersect(Selection, Range("E2:E" & LastRow))
        If c <> vbNullString Then
            hlink = c.Value
            ActiveSheet.Hyperlinks.Add Anchor:=c, _
                Address:="http://fullpath.com/ordernum=" & hlink.Value, _
                TextToDisplay:=c.Value
        End If
    Next c

What I want it to do this this. There sometimes hundreds of rows involving multiple sheets

E
1500067521
2500067522
3500067530
...500067555

<tbody>
</tbody>


E
1500067521
2500067522
3500067530
...500067555

<tbody>
</tbody>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top