Using a Sub to bring up the internet, then return
Is there a way to call up a URL from within a sub, and when done, return to the sub? In my routine I want to have a choice to "Check in wikipedia" but what id any coding will do this?
Pat
»
- Thomas Collins's blog
- Login or register to post comments
- 3120 reads
Sub Linking() Dim sURL As
Sub Linking()
Dim sURL As String, sDisplay As String
sURL = "http://en.wikipedia.org/wiki/Main_Page"
sDisplay = "Wikipedia"
'To place a hyperlink on a worksheet
Range("C11").Select
Selection.Hyperlinks.Add Anchor:=Selection, Address:=sURL, TextToDisplay:=sDisplay
'To activate the hyperlink
Range("C11").Select
ActiveSheet.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub
Appreciated Andy. Copied it
Appreciated Andy. Copied it to execute when I click of the box.
As I run Debug of this section, I get "Compile Error - Expected End Sub". What am I doing wrong?
Private Sub optDrugsYes_Click()
Sub Linking()
Dim sURL As String, sDisplay As String
sURL = "http://en.wikipedia.org/wiki/Main_Page"
sDisplay = "Wikipedia"
'To place a hyperlink on a worksheet
Range("C11").Select
Selection.Hyperlinks.Add Anchor:=Selection, Address:=sURL, TextToDisplay:=sDisplay
'To activate the hyperlink
Range("C11").Select
ActiveSheet.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub
End Sub
You have two End subs at the
You have two End subs at the bottom .. delete one and it will be ok ..:-)