I believe you have run into one of the obscure limitations in the interactions between VBA and Excel. One workaround would be to change the formula to return only a single element, and have the particular element as an argument in the UDF. For example: Option Explicit Function longString(Optional R...

c#,excel,excel-dna,xll,excel-udf

VBA accesses cell contents directly. It uses its native types and 99% of the time a well coded UDF will be faster than an external library doing the same thing. In your example you are doing doing a lot more in the C# version. If you really want to...

Look at the comments for the first explaination. And as you were using row as a variable you couldn't call the Row Property from the Range class, so I changed it to RowV to use RowV.row. Compiling what have been said : Function asda(fval As Range, rng As Range, fCol...

excel-vba,excel-2010,excel-udf

You need to use the WorksheetFunction which are used as a container for Microsoft Excel worksheet functions that can be called from Visual Basic. Function SONxMonth() SONxMonth = WorksheetFunction.EoMonth(Range("A1"), 0) End Func...

sql,excel,function,db2,excel-udf

First thing to check might be that none of the Excel cells contains values that are longer than declared columns in the table function. Remember, column length is specified in bytes, not characters. If your Excel file contains non-ASCII characters a 32-character string might be longer than 32 bytes. Also...

excel,excel-vba,ms-office,excel-udf

Function WoodClassify(...) as Double Classification is a string, and you've set the function to return a double. It can't implicitly convert a string to a double so it gives a value error. If you want the function to return a string that should read: Function WoodClassify(...) as String...

vba,excel-vba,excel-formula,excel-2010,excel-udf

Here is a formula-based alternative that will extract the first 5 digit number found in cell A1. I tend to prefer reasonably simple formula solutions over VBA in most situations as formulas are more portable. This formula is an array formula and thus must be entered with Ctrl+Shift+Enter. The idea...

FindNext doesn't work in UDFs. You have to simply repeat the original Find operation.

I don't think it is possible, but a quite fair solution would be to recalculate when you leave a cell or change it: Private Sub Worksheet_Change(ByVal Target As Range) Me.Calculate End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) Me.Calculate End Sub Or as an alternative, place a button on the...