View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_687_] joel[_687_] is offline
external usenet poster
 
Posts: 1
Default Array formula does not calculate correctly when run from macro


You macro isn't letting the workbook fully update all the calculations.
this could be for a number of different reasons. You could be turing
off screen updating (or not trun screen updating) off.


Are you using a UDF? A UDF for the macro to run porperly must have all
the cell used in the function passed as a parameter. A UDF only gets
run when a parameter in in the function call get changed.
Here is a simply UDF

Function Myfunction()
Myfunction = Range("A1")
end function


This function will never get run because the workbook only call
functions when the cells in the parameter list get changed. A function
should look like this

Function Myfunction(Target)
Myfunction = Target
end function


Then call the function like this
=MyFunction(A1)


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=180681

Microsoft Office Help