Hyperlink to VBA modul

70 views
Skip to first unread message

A0

unread,
Aug 17, 2002, 8:50:26 AM8/17/02
to
Hello,
I saw a worksheet with hyperlink to VBA modul. When you click on the
hyperlink the VBE open in a specific procedure.
I couldn't understand what is the way to do it.
I believe I have to start with CTRL+K......what next ?
Alon


Andy Wiggins

unread,
Aug 17, 2002, 9:08:08 AM8/17/02
to
Depends on which version of Excel you are using.

In Excel 97:
Insert > Hyperlink: In "Named location in file (optional):" put the name of
the procedure.
So if the procedure name is MyProc, you would enter "MyProc".

In Excel 2000:
Insert > Hyperlink: Click on "Existing File or Web Page", then in "Type the
file or Web-page name" put the name of a procedure preceeded by a hash (#).
So if the procedure name is MyProc, you would enter "#MyProc".

In Excel 2002 (XP):
Insert > Hyperlink: Click on "Existing File or Web Page", then in "Address"
put the name of a procedure preceeded by a hash (#).
So if the procedure name is MyProc, you would enter "#MyProc".

Regards
Andy Wiggins FCCA
www.BygSoftware.com
Home of "Byg Tools for VBA" and "The Excel Auditor"


"A0" <oth...@main.aquanet.co.il> wrote in message
news:OD4$vPeRCHA.1676@tkmsftngp12...

David Hager

unread,
Aug 17, 2002, 9:11:18 AM8/17/02
to
See:

http://www.j-walk.com/ss/excel/eee/eee002.txt

--
David Hager
Excel MVP
Baton Rouge, La.

A0 wrote in message ...

A0

unread,
Aug 17, 2002, 10:34:08 AM8/17/02
to

A0 <oth...@main.aquanet.co.il> wrote in message
news:OD4$vPeRCHA.1676@tkmsftngp12...

Dana DeLouis

unread,
Aug 17, 2002, 11:56:17 AM8/17/02
to
Andy. May I ask you a question? When I was trying to figure out how
Microsoft did this on one of their Workbooks, I looked at their HTML code
for that sheet.
I don't know HTML very well. For example, there is this macro named
"Recorded_Macro" in a module.
Some of the HTML code used
href="#Recorded_Macro"></map><img border=0 width=151 ...etc
just like you pointed out.

Other references to this Macro included a leading "#RANGE!"
I don't know what this is referencing. Do you?
"Range" is not a specific Module, or anything else I can figure out.
Do you know HTML to know what this is trying to do.
Perhaps this is referring to the button, or cell, to which this Hyperlink is
assigned???

Here is a copy of the code...
href="#RANGE!Recorded_Macro"><area shape=Rect...etc

Also, I have never been able to figure out how to include a specific module.
Do you know how?

Just a side question. Didn't earlier versions require 3 backslashes? One
of Microsoft's Hyperlink examples used something like "C:\\\..." and pointed
to the workbook, module, and program name. But, I don't remember anymore.

Thanks for any information.
--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Andy Wiggins" <ngr...@bygsoftware.com> wrote in message
news:kXr79.2593$KQ6.1...@newsfep1-win.server.ntli.net...

David McRitchie

unread,
Aug 17, 2002, 1:31:04 PM8/17/02
to
Dana gave a little hope creating a cell hyperlink reference
by mentioning HTML, but like he said you get something like:
<a href="#RANGE!Delete_XYZ">Delete_XYZ</a>

If I create the hyperlink with #Delete_XYZ then the
link works fine even though if you Edit hyperlinks nothing shows.
You can delete the *unseen* hyperlink with the button and
the link will be removed.

My interest was providing a hyperlink to subroutine or to a
function in my [personal.xls]
but it appears that this involves a named range so can only
apply to the current workbook. **any comments**

Incidentally have been using GOTOSUB subroutine
which probably serves the same purpose and allows me
to enter personal.xls!macroname into a cell and
use the GoToSub (coding can be seen in:...)
http://www.mvps.org/dmcritchie/excel/code/buildtoc.txt
macro to goto the subroutine entered in a cell
Application.Goto Reference:=Trim(ActiveCell.Value)

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Macros: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

> "Andy Wiggins" <ngr...@bygsoftware.com> wrote in message

> [...creating a HYPERLINK to a VBA module ....]

David McRitchie

unread,
Aug 17, 2002, 1:59:18 PM8/17/02
to
Glad you got your answer from Andy Wiggins, for
"Hyperlink to a VBA module", but to thank Andy you should
have kept to the same thread,
so everybody, including Andy knows you got your answer.
Correction: You did stick to same thread but you changed the
subject so noone would really notice what thread you replied to.

If the answer is obvious -- no conflicting answers an email would
be an alternative way to provide a Thank You. If you are tempted
to ask an additional question with the Thank You, stick to the
thread (same subject) or post a new question so others also benefit..

Thank you for asking the question, we're continuing the discussion
in your original thread.
http://google.com/groups?as_umsgid=OD4%24vPeRCHA.1676@tkmsftngp12

Since you are using Outlook Express, it might be useful to create
rule and a view to spot your own postings, select your post, then switch
from "Hide Read Messages" to "Show All Messages" to help
see the entire thread. More information on OE5 and OE6
http://www.mvps.org/dmcritchie/excel/OE5.htm

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Macros: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"A0" <oth...@main.aquanet.co.il> wrote in message news:OVOMxJfRCHA.1784@tkmsftngp12...

Dana DeLouis

unread,
Aug 17, 2002, 3:49:11 PM8/17/02
to
Hi David. Just to add. You may already know this, but examples of
hyperlinking to VBA programs has usually been included with Microsoft
Office.
A good example of this can be found in "Samples.xls" on your hard drive.

For Office XP, it is at:
"...Microsoft Office\Office10\Samples"

Same for earlier versions. :>)


--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"David McRitchie" <dmcri...@msn.com> wrote in message
news:#7sB#PhRCHA.1496@tkmsftngp11...

John Walkenbach

unread,
Aug 17, 2002, 3:55:07 PM8/17/02
to
That's a good one, Andy.

I wonder why MS would add the capability to hyperlink to a VBA procedure,
but not to a Chart sheet?

John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss

"Andy Wiggins" <ngr...@bygsoftware.com> wrote in message

news:kXr79.2593$KQ6.1...@newsfep1-win.server.ntli.net...

Andy Wiggins

unread,
Aug 17, 2002, 6:24:42 PM8/17/02
to
Hi John & Dana,

As well as Chart sheets, I don't think it's possible to link to anything in
a class modules, user forms or sheet modules. But even in its limited form I
have found it very useful especially whilst working on client projects and
also in some of the demonstration workbooks I provide.

On client projects I create an "index" sheet containing links to the main
procedures. For example, I will try and include as least one procedure from
each module. When you have several workbooks open this is a quick way to get
to either the right place, or very near to it! It's also a useful way of
creating some basic (ho ho) documentation.

Sorry Dana, I'm as lost with Microsoft's HTML description of workbooks as
you appear to be :-)

Regards
Andy Wiggins FCCA
www.BygSoftware.com
Home of "Byg Tools for VBA" and "The Excel Auditor"

"John Walkenbach" <jo...@j-walk.com> wrote in message
news:eQlHPgiRCHA.1648@tkmsftngp08...

David McRitchie

unread,
Aug 17, 2002, 10:20:26 PM8/17/02
to
Hi Dana,
Thanks for pointing out the "Samples.xls" that came with the
installation of Excel and can be found with search..
It certainly looks like the hyperlink to code was an afterthought
just to make the samples.xls be able to show the code.

At least that's my opinion until someone can point to where
it's usage is actually documented. Remember it works but
does not show up in Edit Hyperlinks, and noone has shown
that it works to for the other open workbooks as well.

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Macros: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Dana DeLouis" <ng_...@hotmail.com> wrote in message news:eyrFqciRCHA.2548@tkmsftngp12...

John Walkenbach

unread,
Aug 17, 2002, 10:53:11 PM8/17/02
to
It may be an afterthought. But it's exactly what happens when you type a
procedure name into the Name box, and then press Enter.

John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss

"David McRitchie" <dmcri...@msn.com> wrote in message

news:O$pt03lRCHA.4088@tkmsftngp09...

Reply all
Reply to author
Forward
0 new messages