MrExcel Publishing
Your One Stop for Excel Tips & Solutions

How to execute a function created in VB from a cell

Posted by Camilo on October 24, 2000 12:55 PM


I have a subroutine in an MS Excel module and functions well but i need execute them from a cell, like Sum or another intrinsec function of MS Excel.

Thanks in advance.

Posted by Ivan Moala on October 25, 2000 1:01 AM

Assumning you have a Function with the following
syntax Function MyFunc(Test as Range,X as integer) as Double

Then to use it in a cell just type in asa normal formula
eg. = MyFunc(data,data) or use the Paste function
button and select User Defined and select your function from the list.