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


Hi all

I suspect that this is a really simple easy question but it is annoying
with the lack of information available......

I have created a function called

weekno(ipdata as date) as integer

and have put it in -thisworkbook- on the vba editor.....

Firstly is this the correct place to put functions or do I need a
module?
Secondly is I go to any of the sheets and in a cell put =weekno(K4) for
example, I get #Name? - how do I make it reference -thisworkbook- to
tell it that the function is located there?

Any help is appreciated.


--
-=Merovingian=-


------------------------------------------------------------------------
-=Merovingian=-'s Profile: http://www.excelforum.com/member.php...o&userid=28443
View this thread: http://www.excelforum.com/showthread...hreadid=480421

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Creating Functions

The simple solution would be to put the function in a module.

--
Cheers
Nigel



"-=Merovingian=-"
wrote in message
...

Hi all

I suspect that this is a really simple easy question but it is annoying
with the lack of information available......

I have created a function called

weekno(ipdata as date) as integer

and have put it in -thisworkbook- on the vba editor.....

Firstly is this the correct place to put functions or do I need a
module?
Secondly is I go to any of the sheets and in a cell put =weekno(K4) for
example, I get #Name? - how do I make it reference -thisworkbook- to
tell it that the function is located there?

Any help is appreciated.


--
-=Merovingian=-


------------------------------------------------------------------------
-=Merovingian=-'s Profile:

http://www.excelforum.com/member.php...o&userid=28443
View this thread: http://www.excelforum.com/showthread...hreadid=480421



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Creating Functions

"-=Merovingian=-"
wrote in message
...

[...]
Firstly is this the correct place to put functions or do I need a
module?
Secondly is I go to any of the sheets and in a cell put =weekno(K4) for
example, I get #Name? - how do I make it reference -thisworkbook- to
tell it that the function is located there?


Put in a module all you need do be "visible" from anywhere.

Ciao
Bruno


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Creating Functions

Hello,

Thisworkbook is a place to put a code if you want to bind the code to an
event. (ex. Workbook_Open located in Thisworkbook is triggered when the
workbook opens)

Functions that you want available all the time as long as this workbook is
open, you put in a module.

Remember yet that if you have activated the following command

AddIn from the menu Tools-AddIns...-Analysis ToolPack

then you already have enabled a function =WEEKNUM(date) that returns a
weeknumber of a givendate.

Regards, Mika

"-=Merovingian=-"
wrote in message
...

Hi all

I suspect that this is a really simple easy question but it is annoying
with the lack of information available......

I have created a function called

weekno(ipdata as date) as integer

and have put it in -thisworkbook- on the vba editor.....

Firstly is this the correct place to put functions or do I need a
module?
Secondly is I go to any of the sheets and in a cell put =weekno(K4) for
example, I get #Name? - how do I make it reference -thisworkbook- to
tell it that the function is located there?

Any help is appreciated.


--
-=Merovingian=-


------------------------------------------------------------------------
-=Merovingian=-'s Profile:

http://www.excelforum.com/member.php...o&userid=28443
View this thread: http://www.excelforum.com/showthread...hreadid=480421





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
Creating Nested Functions Debra Lisa Excel Discussion (Misc queries) 3 August 26th 07 01:16 PM
creating functions grumpy Excel Worksheet Functions 4 July 14th 06 09:31 AM
creating new functions Peter R Knight Excel Worksheet Functions 3 September 19th 05 02:03 PM
Creating Help within functions Joe Carroll Excel Programming 1 June 5th 05 03:56 AM
Creating a functions Kimi Excel Worksheet Functions 1 April 8th 05 05:27 AM


All times are GMT +1. The time now is 07:49 PM.

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

About Us

"It's about Microsoft Excel"