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

I would like to use a home made FUNCTION to divide two numbers
So far In a module I have placed the following code:
Function cutit(a%,b%)
cutit=a%/b%
end function
In the spread sheet I call the function:
=cutit(12,6)

I them get the error message NAMe$
what am I doing wrong
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Using functions

On Aug 30, 2:08*pm, pcor wrote:
I would like to use a home made FUNCTION to divide two numbers
So far In a module I have placed the following code:
Function cutit(a%,b%)
cutit=a%/b%
end function
In the spread sheet I call the function:
=cutit(12,6)

I them get the error message NAMe$
what am I doing wrong


Although you could just use =12/6 I suspect that if you take your
function out of the SHEET module and place in a REGULAR module, it
will work....
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Using functions

Your UDF works for me as is when function is in same workbook.

=cutit(12,6) returns 2

Where do you have it stored?

A module in the workbook or a module in an external workbook like Personal.xls?

=Personal.xls!cutit(12,6) would be OK


Gord Dibben MS Excel MVP

On Mon, 30 Aug 2010 12:08:39 -0700 (PDT), pcor wrote:

I would like to use a home made FUNCTION to divide two numbers
So far In a module I have placed the following code:
Function cutit(a%,b%)
cutit=a%/b%
end function
In the spread sheet I call the function:
=cutit(12,6)

I them get the error message NAMe$
what am I doing wrong

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
Autocomplete Custom Functions and functions arguments Subodh Excel Programming 1 May 21st 10 02:24 AM
User defined functions that are array functions Richard Excel Programming 1 October 22nd 09 06:56 PM
How to convert cell formula functions to code functions Adnan Excel Discussion (Misc queries) 1 October 1st 08 08:30 PM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Conversion from Spreadsheet Toolkit functions (ESSV....) to EssBase API functions sujay Excel Programming 0 June 5th 06 10:13 AM


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