Trying to put a variable in a URL to be Hyperlinked. Help please

RooparDE11

New Member
Joined
Sep 24, 2014
Messages
4
So I'm trying to put a variable into a URL that is going to be hyperlinked. if i do a " & Folder1 & " then it simply leaves it out and merges the URL without inputting what is within the variable Folder1. The same goes for Plant and Manifest.
What's in red is my problem. Help please.

Here's what I've got:

Dim Plant As String
Dim Folder1 As String
Dim Manifest As String

Manifest = ThisWorkbook.ActiveSheet.Cells(Rb, C).Value

ThisWorkbook.ActiveSheet.Hyperlinks.Add Anchor:=Cells(Rb, Cl), Address:="https://controls.company.com/station/decom/" & Plant & "/Environmental/" & Folder1 & "/Manifest.pdf", TextToDisplay:=Manifest
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
So after much debugging I found that I was simply not referencing the correct sheet.

So if you need this and it helps you then here's the correct macro.


Function hyperL(R, C, Rl, Ro, Rb, Cl, Manifest)

Dim Plant As String
Dim Folder1 As String
Dim Manifest As String

Manifest = ThisWorkbook.ActiveSheet.Cells(Rb, C).Value
Call Identifyer(Plant, Folder1)
ThisWorkbook.ActiveSheet.Hyperlinks.Add Anchor:=Cells(Rb, Cl),_ Address:="https://controls.company.com/station/decom/" & Plant & "/Environmental/" & Folder1 & "/" & Manifest & ".pdf", TextToDisplay:=Manifest
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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