Hi folks,
I was able to find an answer to part of my problem and was able to open hyperlinks in a range of selected (highlighted by dragging cursor) cells in Excel. BUT... It only worked if the hyperlink is showing and not hidden by "friendly text".
When I use the code below to select cells with hyperlinks (URLs) everything is great and they open in the default browser. What I would like is to be able to open Hyperlinks that is displaying "friendly text". . =HYPERLINK("http://jsvp/MoveImage.aspx?t=1&sku="&A13,A4). This shows the word "upload" in the cells.
Sample Hyperlink
I get the following error when I try to open selected friendly text hyperlinks as shown above..
QUESTION: Would there be a way open the URLs even if the text was hiding the Hyperlink (URL)?
Credit to: PETER ALBERT (User Peter Albert) for his code.
This code works well when the complete URL in the hyperlink is visible in the cell but not when hidden by friendly txt.
QUESTION: One more thing... Can the code be applied to only visible cells in the selection when rows are filtered?
Any hep would be appreciated. I am a novice coder so please could you share any code as fully as possible and let me know what I need to customize if anything.
When code runs on selected friendly text hyperlinks:
When I hit Open:
Cheers!
Limey
I was able to find an answer to part of my problem and was able to open hyperlinks in a range of selected (highlighted by dragging cursor) cells in Excel. BUT... It only worked if the hyperlink is showing and not hidden by "friendly text".
When I use the code below to select cells with hyperlinks (URLs) everything is great and they open in the default browser. What I would like is to be able to open Hyperlinks that is displaying "friendly text". . =HYPERLINK("http://jsvp/MoveImage.aspx?t=1&sku="&A13,A4). This shows the word "upload" in the cells.
Sample Hyperlink
=IF(LEN(A3)>5,"",HYPERLINK("https://supercms.company.com/ManageProducts/"&LEFT(A3,5),A3)) This displays a value from Cell A3.
I get the following error when I try to open selected friendly text hyperlinks as shown above..
Run-time error '-2147221014 (800401ea)' Cannot open specified file
QUESTION: Would there be a way open the URLs even if the text was hiding the Hyperlink (URL)?
Credit to: PETER ALBERT (User Peter Albert) for his code.
VBA Code:
Sub Open_SelectedTextlinks()
Dim c As Range
If Not TypeOf Selection Is Range Then Exit Sub
For Each c In Selection.Cells
If c.Hyperlinks.Count = 0 Then
ActiveSheet.Hyperlinks.Add Anchor:=c, _
Address:="http://" & c.Value 'Depending on the content of your cell, remove the "http://" & part
End If
c.Hyperlinks(1).Follow
Next
End Sub
This code works well when the complete URL in the hyperlink is visible in the cell but not when hidden by friendly txt.
QUESTION: One more thing... Can the code be applied to only visible cells in the selection when rows are filtered?
Any hep would be appreciated. I am a novice coder so please could you share any code as fully as possible and let me know what I need to customize if anything.
When code runs on selected friendly text hyperlinks:
When I hit Open:
Cheers!
Limey