'How to use an entry in a vba textbox as the "Link Location" within the hyperlink formula?
I'm still reasonably new to VBA and I'm trying my best to learn, but this one has stumped me.
I have a Userform
where one of the textboxes is for a user to enter the weblink to a product specification on a manufacturers website. From there I intend to have the data entered into a database alongside the other data in the Userform
, but with the weblink run through the Hyperlink formula within the VBA code so that I can have the "friendly name" read as 'Link' rather than the full address.
Everything else is working fine, and the hyperlink itself is simple enough obviously, however I'm really stuck on how to use the link entered in the textbox as the "link location"
If TextBox_URL = "" Then
Sheets("Add").Range("DataStart").Offset(TargetRow, 6).Value = "N/R"
Else
Sheets("Add").Range("DataStart").Offset(TargetRow, 6).Formula = **"=HYPERLINK("TextBox_URL.Value", "Link")"**
End If`
Apologies if my explanation isn't clear enough, hopefully someone has what I'm sure is a really obvious solution!
Cheers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|