Adding a function to strip the address from a hyperlink

G

Guest

I somehow added a function to a workbook that strips the address from a
hyperlink. It's now resident in the workbook. I'm not sure how I did it.
What I'd like to do now is

1) Create the function so that I can access it from every workbook.
2) Delete it from the workbooks that it's already in.

Can someone assist?

Thanks in advance,
Barb Reinhardt
 
T

Tom Ogilvy

You would need to find the function in the code modules and remove it.

You would need to put it in another workbook and make that workbook and
addin.

then load the addin.

Then the function should be available to all workbooks opened in your
install of excel.
 
G

Guest

Thanks. I've removed the code modules from the affected workbooks, but can't
seem to get the code to work now. This is what I'm "reusing" and it's
giving me a 0 (zero) when there is a hyperlink.

Function GetAddress(HyperlinkCell As Range)
GetAddress = Replace _
(HyperlinkCell.Hyperlinks(1).Address, "mailto:", "")
End Function

I lifted this, so am not sure what to do next.

Thanks!

Barb Reinhardt
 
T

Tom Ogilvy

I can't reproduce getting a zero. I moved the function to an addin and
loaded the addin, but the original workbook had problems recognizing the
function (a new workbook had no problem and it worked fine). In the
original workbook, I had to put in

=TestAddin.xla!GetAddress(A1)

to avoid the #Name error. I believe this is because even though the the
function has been deleted, it is still remembered. This might be cleared up
by closing the original workbook and reopening it, but since I hadn't save
it, I didn't test that.
 
G

Guest

I got it working. I'm still a bit confused on some issues, but got it working.

Thanks,
Barb Reinhardt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top