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:

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

RooparDE11

New Member
Joined
Sep 24, 2014
Messages
4
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,047
Messages
5,599,497
Members
414,315
Latest member
Yolanda5050

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
Top