[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2014-12-28
2
Medium Priority
?
127 Views
Last Modified: 2015-01-12
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
Comment
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
  • Learn & ask questions
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 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

Open in new window

0
 
LVL 3

Author Comment

by:Ed Covney
ID: 40520759
Graham -

I tried it and I like it !!!

Thank you, thank you, thank you.

- Ed
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question