How to make the result of this function "clickable"?

makiwara

Board Regular
Joined
Mar 8, 2018
Messages
171
Hi!

I have the following code:

Code:
Public Function urlID(InputCell As String)


Dim s As String
s = "https://google.com/"


urlID = s & InputCell




End Function

But the result is just for example: "www.google.com/table" with black colour.

How can I make it a clickable Hyperlink (within that function)? Thank you for your help, it means me a lot! Have a nice day!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Will a native Excel HYPERLINK function work for you?

=HYPERLINK("https://google.com/"&A1)
 
Upvote 0
Thank you for your reply!

I'm using your method actually, but it takes too much time to type the start of the url every time, because I have 5-6 types of URL-s which has to be generated :-)

How could I insert this thing into one VBA Function Procedure?

I really appreciate any help I got, since I'm stucked with this problem for 3-4 days!

Thank you for your help!
Have a very nice day!


Will a native Excel HYPERLINK function work for you?

=HYPERLINK("https://google.com/"&A1)
 
Last edited:
Upvote 0
I'm sorry but you can only use a UDF to return a value, you can't use one to create a hyperlink in a cell/on a worksheet.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

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