Solved

# How do I call an Excel Function (COMBIN) from my user created function?

Posted on 2014-12-28
113 Views
I pass 4 variables to a VBA function, and from them calculate 8 dependent variables from which I need to calculate and pass back to the Excel cell:

FName = ( Combin(n1,n2) * Combin(n3,n4 ) +  ( Combin(n5,n6) * Combin(n7,n8 ) )

One by one I can return n1 - n8 and the numbers are correct, but I can't even get constants to work:  i.e.  FName  =  Combin(5,3)

Err: (With "Combin" hi-lited):   Compile error: Sub or Function not defined

Any help with syntax will be greatly appreciated.

- Ed
0
Question by:Ed Covney
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 76

Accepted Solution

GrahamSkan earned 500 total points
ID: 40520697
Try it like this

``````With Application.WorksheetFunction
Fname = .Combin(n1, n2) * .Combin(n3, n4) + .Combin(n5, n6) * .Combin(n7, n8)
End With
``````
0

LVL 3

Author Comment

ID: 40520759
Graham -

I tried it and I like it !!!

Thank you, thank you, thank you.

- Ed
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
###### Suggested Courses
Course of the Month2 days, 17 hours left to enroll