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.
What I want it to do this this. There sometimes hundreds of rows involving multiple sheets
[TABLE="class: grid, width: 250, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]500067521[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]500067522[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]500067530[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]500067555[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 250, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]500067521[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]500067522[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]500067530[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]500067555
[/TD]
[/TR]
</tbody>[/TABLE]
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
[TABLE="class: grid, width: 250, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]500067521[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]500067522[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]500067530[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]500067555[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 250, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]500067521[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]500067522[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]500067530[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD]500067555
[/TD]
[/TR]
</tbody>[/TABLE]