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>
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Watch MrExcel Video

Forum statistics

Threads
1,099,794
Messages
5,470,825
Members
406,727
Latest member
Kimze

This Week's Hot Topics

Top