Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Availability of UDF

I have many macros in a module in my PERSONAL.XLS that I can use in any
sheet.

I have created a function thus:

Public Function getnum(ip As String) As Integer
getnum = Val(ip)
End Function

and placed it in the same module, but if I try to use it in a sheet I get a
#NAME? error.

If I create a module in the specific workbook and put the function in it
then it works fine.

So how do I make a function in my PERSONAL.XLS file available to all sheets?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Availability of UDF

Paul,

To call functions in another workbook, you have to use the
workbook name in the function call. E.g.,

=Personal.xls!GetNum(A1)

If you put functions in an add-in (an XLA file), you don't need
to use the workbook name in the call.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Paul Lautman" wrote in message
...
I have many macros in a module in my PERSONAL.XLS that I can

use in any
sheet.

I have created a function thus:

Public Function getnum(ip As String) As Integer
getnum = Val(ip)
End Function

and placed it in the same module, but if I try to use it in a

sheet I get a
#NAME? error.

If I create a module in the specific workbook and put the

function in it
then it works fine.

So how do I make a function in my PERSONAL.XLS file available

to all sheets?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Availability of UDF

You have to qualify with the filename, like so

=PERSONAL.XLS!foo()

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Paul Lautman" wrote in message
...
I have many macros in a module in my PERSONAL.XLS that I can use in any
sheet.

I have created a function thus:

Public Function getnum(ip As String) As Integer
getnum = Val(ip)
End Function

and placed it in the same module, but if I try to use it in a sheet I get

a
#NAME? error.

If I create a module in the specific workbook and put the function in it
then it works fine.

So how do I make a function in my PERSONAL.XLS file available to all

sheets?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Availability of UDF

Thanks Chip (and Bob).
I knew I could do it in an XLA, but I couldn't figure why it didn't work
from my PERSONAL.XLS file.

Thanks again

"Chip Pearson" wrote in message
...
Paul,

To call functions in another workbook, you have to use the
workbook name in the function call. E.g.,

=Personal.xls!GetNum(A1)

If you put functions in an add-in (an XLA file), you don't need
to use the workbook name in the call.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Paul Lautman" wrote in message
...
I have many macros in a module in my PERSONAL.XLS that I can

use in any
sheet.

I have created a function thus:

Public Function getnum(ip As String) As Integer
getnum = Val(ip)
End Function

and placed it in the same module, but if I try to use it in a

sheet I get a
#NAME? error.

If I create a module in the specific workbook and put the

function in it
then it works fine.

So how do I make a function in my PERSONAL.XLS file available

to all sheets?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining availability time Steve Excel Discussion (Misc queries) 2 July 10th 09 02:44 PM
Button availability Jeff Parrott Excel Discussion (Misc queries) 3 December 11th 08 04:13 PM
availability templates cesar Excel Discussion (Misc queries) 1 May 2nd 07 03:02 AM
Calendar availability mindmeister Excel Discussion (Misc queries) 0 January 4th 07 04:58 PM
StackedColumnChart for availability using macro excelprogrammer Charts and Charting in Excel 0 September 2nd 05 01:04 PM


All times are GMT +1. The time now is 12:10 AM.

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

About Us

"It's about Microsoft Excel"