Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to create a function in a code sheet

Hi!

I need to create a function that I will use in a worksheet. However,
I need to create it in a worksheet code (not in a separate module, but
in the "Microsoft Excel Objects").

I know it works for a macro, but not for a function. I tried to call
my function with "private function", "public function", but it doesn't
work.

Thanks for your help guys!

Mathieu
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default How to create a function in a code sheet

Hi Mathieu

Why on earth do you "need to create it in a worksheet code, not in a
separate module" ? Insert a regular module and write your function, end
users don't care where or how functions are written.

HTH. Best wishes Harald

"Mathieu936" wrote in message
...
Hi!

I need to create a function that I will use in a worksheet. However,
I need to create it in a worksheet code (not in a separate module, but
in the "Microsoft Excel Objects").

I know it works for a macro, but not for a function. I tried to call
my function with "private function", "public function", but it doesn't
work.

Thanks for your help guys!

Mathieu


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default How to create a function in a code sheet

Hi Mathieu

If you put the line below in the separate module your users will not
find the function in the list of t category User Defined

Option Private Module.


HTH,

Wouter
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to create a function in a code sheet

I want to include the functions in the worksheet code because I have
to copy the worksheet, and I don't want to copy a module with it.
That's the only reason.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to create a function in a code sheet

On 1 juin, 13:09, Mathieu936 wrote:
I want to include the functions in the worksheet code because I have
to copy the worksheet, and I don't want to copy a module with it.
That's the only reason.


anyone has an idea?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default How to create a function in a code sheet

On Jun 11, 12:39*pm, Mathieu936 wrote:
On 1 juin, 13:09, Mathieu936 wrote:

I want to include the functions in the worksheet code because I have
to copy the worksheet, and I don't want to copy a module with it.
That's the only reason.


anyone has an idea?


An alternate approach to worksheet event macro in the sheet. The
macro would:

1. test for the existence of a module called mathieu
2. if the module already exists in the work book, just exit
3. create the module
3. populate the newly created module with any functions or sub you
need.
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
Use VBA to create new sheet with event handlers in sheet's code VBAer Excel Programming 2 November 24th 09 07:22 AM
create new sheet with zip code as name Rich Excel Programming 5 July 28th 09 11:19 AM
Code to create atbs in excel sheet deepa prabhakar Excel Discussion (Misc queries) 1 May 26th 06 09:28 PM
Code to create tabs in single excel sheet deepa prabhakar Excel Discussion (Misc queries) 1 May 26th 06 10:15 AM
Code to create and name a sheet dogpigfish Excel Programming 8 January 5th 06 03:10 AM


All times are GMT +1. The time now is 12:07 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"