I want it return multiple values from a VBA function called from an Excel spreadsheet but always get the error #Value!
One example found on the web:
Sub ReturnCellValue()
Worksheets("Sheet1").Range("A1").Value = 3.14159
End Function
This Function returns #Value!
Function ReturnCellValue()
Worksheets("Sheet1").Range("A1").Value = 3.14159
End Function
This single line of code works in the immediate winnow.
Worksheets("Sheet1").Range("A1").Value = 3.14159
All of the examples I have found have been sub. How do you call a sub from a function?