Activating Hyperlinks via VBA

thomassharp

Board Regular
Joined
Dec 10, 2014
Messages
84
Hi, I have 2 questions. First, is it possible to use the script mentioned here: http://www.mrexcel.com/forum/excel-...hyperlinks-via-visual-basic-applications.html

Sub Hyperlink()

Shell "explorer.exe " & Range("J2").Text
End Sub

To activate a cell range? I.e could it open several links at once in the browser?

Secondly, is there a simply way to automate the F2/return key stroke to activate a cell so the Hyperlink becomes active. I've tried lots of different things but none of them seem to just automate the manual key stroke.

Thanks very much for any help you can give!

:wink:
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
HI again, do you know why the code selects column B in my worksheet? What part would I have to modify to change the range of cells. The normal select codes I use won't run within this code...Thx

Sub Test()
Dim LastRow As Long, i As Long LastRow = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row For i = 2 To LastRow With Cells(i, 2) If .Value <> "" Then ActiveSheet.Hyperlinks.Add Anchor:=.Cells(1, 1), Address:=.Value End If End With Next iEnd Sub
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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
Back
Top