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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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