Hi! I have a button with an assigned macro to it, which follows every hyperlink in the selected cells.
But I can't create a customized URL in VBA (using a new FUNCTION), because it shows an error message every time I try to follow the new url using the macro.
However, if I type the same URL manually, everything goes fine: the macro follows it and opens in a browser.
______________________________________
So shortly:
The output I need:
A1 B1 C1
h"ttps://www.google.hu/search?q= apple h"ttps://www.google.hu/search?q=apple
If this output is made manually (--> I type it), then the macro works fine.
But if I make it using a FUNCTION, the result is the same URL for the first sight, but neither my macro can open it nor me (clicking on it).
My macro (this is correct, it's 100%)
______________________________________
Can you help me with an URL editor Function, which creates a real clickable Hyperlink?
For example: google(String)
=google(apple) --> https://www.google.hu/search?q=apple
Thank you for your help, have a very nice day!
But I can't create a customized URL in VBA (using a new FUNCTION), because it shows an error message every time I try to follow the new url using the macro.
However, if I type the same URL manually, everything goes fine: the macro follows it and opens in a browser.
______________________________________
So shortly:
The output I need:
A1 B1 C1
h"ttps://www.google.hu/search?q= apple h"ttps://www.google.hu/search?q=apple
If this output is made manually (--> I type it), then the macro works fine.
But if I make it using a FUNCTION, the result is the same URL for the first sight, but neither my macro can open it nor me (clicking on it).
My macro (this is correct, it's 100%)
Code:
Sub Hyperlink_Follow()Dim c As Range
Dim url As String
For Each c In Selection.Cells
url = ""
On Error Resume Next
url = c.Hyperlinks(1).Address
If url = "" Then url = c.Value
ThisWorkbook.FollowHyperlink url
Next
End Sub
______________________________________
Can you help me with an URL editor Function, which creates a real clickable Hyperlink?
For example: google(String)
=google(apple) --> https://www.google.hu/search?q=apple
Thank you for your help, have a very nice day!
Last edited: