Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default vba function module returns #NAME?

It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default vba function module returns #NAME?

See your earlier duplicate post.

"Rick" wrote in message ...
It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default vba function module returns #NAME?

I just tested your function in a REGULAR module and it worked just fine.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick" wrote in message
...
It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default vba function module returns #NAME?

Don:

What is a "regular" module?


"Don Guillett" wrote in message
...
I just tested your function in a REGULAR module and it worked just fine.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick" wrote in message
...
It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default vba function module returns #NAME?

a regular module is the standard module you get when you use INSERT/MODULE
from the development IDE
-- as apposed to a Class module or code modules behind sheets and so on.
the default name will be Module1, then Module2 and so on.

If your module is named 'Class1' then this is the default name for a Class
Module, which is the wrong place for your code. cut and paste it into a
standard module, delete the class modue and see if that works

"Rick" wrote in message
...
Don:

What is a "regular" module?


"Don Guillett" wrote in message
...
I just tested your function in a REGULAR module and it worked just fine.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick" wrote in message
...
It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default vba function module returns #NAME?

On Mon, 1 Jun 2009 14:52:04 -0700, "Rick" wrote:

It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.


What is the name of the Module?
--ron
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default vba function module returns #NAME?

It's module1. I was trying to use it in the commission column. when I moved
it to another column it worked. go figure. Thanks for all your help!

Rick

"Ron Rosenfeld" wrote in message
...
On Mon, 1 Jun 2009 14:52:04 -0700, "Rick" wrote:

It's a simple function, so far:

Function Commission(Fee)
If Fee = 45 Then Commission = 15 Else Commission = Fee * 0.35
End Function

I've named my ranges. The module is in VBAProject | Modules.

I'm at a loss.


What is the name of the Module?
--ron


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default vba function module returns #NAME?

On Tue, 2 Jun 2009 10:53:31 -0700, "Rick" wrote:

It's module1. I was trying to use it in the commission column. when I moved
it to another column it worked. go figure. Thanks for all your help!

Rick


Glad you got it working. Although I doubt that moving a properly formed
formula from one column to another would have gotten rid of a #NAME error.
--ron
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
vba function returns #name? Rick[_37_] Excel Programming 1 June 1st 09 10:59 PM
IF function returns function statement rather than result ckrogers Excel Worksheet Functions 3 April 16th 09 09:21 PM
Running macros it returns compile error in hidden module [email protected] Excel Programming 1 December 1st 06 04:04 PM
Insert function - custom function name preceded by module name [email protected] Excel Programming 1 April 2nd 06 03:46 PM
Function returns a zero value Dick Kusleika Excel Programming 0 July 29th 03 05:01 PM


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