A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Having a macro/function available in new spreadsheets



 
 
Thread Tools Display Modes
  #1  
Old April 2nd, 2010, 01:43 PM posted to microsoft.public.excel.misc
wildetudor
external usenet poster
 
Posts: 76
Default Having a macro/function available in new spreadsheets

Hi everyone,

I wanted to define a function that would be available in all new
spreadsheets that I create from now on, so I defined a macro in the Personal
workbook (Personal.xlsb) and then manually pasted the code of function I
needed into the macro, such that the code of the macro looked something like
this:

Function functionName
...
End Function

After saving, hiding Personal.xlsb (from View|Hide) and restarting Excel, I
noticed that new spreadsheets did not know of this new function that I
created; the function was only available in Personal.xlsb itself, upon
unhiding it from the View menu.

I have to say that I am a rookie when it comes to macros&VBA, so I might be
making some pretty blatant confusions here between macros and functions. Can
anyone suggest how to make that function be universally available in all
spreadsheets (at least in those created from now on, if not also in
pre-exsiting ones)? Many thanks for any replies!
  #2  
Old April 2nd, 2010, 01:52 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Having a macro/function available in new spreadsheets

Hi,

Cal your function like this

=PERSONAL.XLSB!Function_Name()

Or have a look here

http://www.rondebruin.nl/personal.htm
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"wildetudor" wrote:

Hi everyone,

I wanted to define a function that would be available in all new
spreadsheets that I create from now on, so I defined a macro in the Personal
workbook (Personal.xlsb) and then manually pasted the code of function I
needed into the macro, such that the code of the macro looked something like
this:

Function functionName
...
End Function

After saving, hiding Personal.xlsb (from View|Hide) and restarting Excel, I
noticed that new spreadsheets did not know of this new function that I
created; the function was only available in Personal.xlsb itself, upon
unhiding it from the View menu.

I have to say that I am a rookie when it comes to macros&VBA, so I might be
making some pretty blatant confusions here between macros and functions. Can
anyone suggest how to make that function be universally available in all
spreadsheets (at least in those created from now on, if not also in
pre-exsiting ones)? Many thanks for any replies!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:44 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.