Excel: customized function to run in macro and not as formula


Hello I have a custom made function (given below) that does a lot of processing and gives an output. Column A has a lot of data that is processed by the function. So far I was using this as a formula but I have observed that when my data in the excel file increases, the file becomes slow as it calculates again and again. I want to calculate everything only once. Can someone please suggest a solution?


Function foo(sData As String) As String
  .
  .
  processing happens here
  .
  .
  foo="answer"
End Function
Instead of writing a formula "=foo(A1)" in B1 and dragging it all the way down, appreciate if someone could suggest a macro-based answer. Thank you.


This question generated 10 answers. To proceed to the answers, click here.

This thread is current as of November 02, 2014.


For more resources for Microsoft Excel