I have a simple userform where a variable named X is set, depending on a combobox, as seen below..
Private Sub ComboBox1_Change()
If ComboBox1 = "Order" Then
    X = "http://-- website address --""
End If
MsgBox X
End Sub
it's not the whole code but just to see what is needed. When a user selects 'Order' from the combobox, variable X should be a specific website.
It works because a messagebox is shown with the correct website.

Now I also have a Button in the userform and when this button is pressed, it should open the website (X) in a new window, but this doesn't work...
the code for the button is:
Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink X, NewWindow:=True 
End Sub
However, the variable X is no longer filled with the website address !

I think it's because I used the End Sub and start a new Sub but I'm not sure how to do the trick so the website opens when the button is pressed