Search code examples
excelvbahyperlinkuserform

Excel VBA userform open hyperlink with a button


I have a userform which I input information into, one of the inputs are called webpage and I want to open the webpage for each item I input into the userform when I click a command button.

Sheets("Data").Range("DataStart").Offset(TargetRow, 10).Value = Webpage

MyForm.Webpage = Sheets("Data").Range("DataStart").Offset(TargetRow, 10).Value

I am trying to use follow.hyperlink

Private Sub Webpage_Click()

Dim webpage As String
Set webpage = MyForm.Webpage = Sheets("Data").Range("DataStart").Offset(TargetRow, 10).Value

ActiveWorkbook.FollowHyperlink Address:="webpage"

End Sub

This doesn´t work.


Solution

  •  ActiveWorkbook.FollowHyperlink Address:=webpage
    

    no quotes