Hi
I am quit new with working with VBA.
I have a lot of UDF in my sreadsheet and it is working very slow.
Therefore I am looking for a way to read inn all the input data in an array, calculate the functions
in vba and then print the results back to another spreadsheet. I guess this would be much faster,but
I have trouble understanding arrays....
This is the code I have come up with so far, but it is not working at all rather than printing some text back to the spreadsheet.
Public Sub main()
For k = 2 To 20000 ' 2000 is max
u = Readmembers(k)
Readmembers (k)
Printresults (k)
Next k
End sub
Public Function Readmembers(j)
'read data for use in the UDF Testfunction
x = Worksheets("input_UDF").Cells(j, 1)
b = Worksheets("input_UDF").Cells(j, 2)
s = Worksheets("input_UDF").Cells(j, 3)
End Function
Public Sub Printresults(j)
Worksheets("Print result").Cells(j, 1) = "Testfunction" ' The result from the fuction here
End Sub
Function Testfunction(x, b, s)
Testfunction = x * b * s
End Function
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. Well, you're not new, but you only have 2 posts. --6StringJazzer
Thanks for any help.
Bookmarks