Hyperlink function not working in VBA

zakthemaster

New Member
Joined
Jul 6, 2010
Messages
2
Function Link(gccode)
Link = (URL Begining) & VBAProject.Module1.Gcid(gccode)
End Function

Function Gcloglink(gccode)
Gcloglink = Application.WorksheetFunction.Hyperlink(VBAProject.Module1.Link(gccode), "Log GC" & UCase(gccode))
End Function

Here is the end part of my code.
My code only has functions being made
the first function works.
The second function results in "#VALUE!" when i type it into a cell.
I want it where when I type "=Gcloglink(A1)" into a cell it will give me the same results as when I type "=HYPERLINK(Link(A1),"Log GC"&UPPER(A1)) into a cell (including the ability to click on the cell and be taken to the webpage.)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I don't need to use a udf at all
I actually first made a spreadsheet using a super long formula but I wanted to make it look nice if someone were to select the cell formula.
I also know that I could just hide my columns.
But I wanted to make it into it's own function so that my target users would understand what it is supposed to be used for if they selected the formula.
Thanks

I guess I will just go without using the vba the way I wanted

On the plus side while converting my formulas to vba I found neater was to make my formula do what I want
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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