Forum Discussion
rjarrett62
Sep 27, 2022Copper Contributor
Evaluate Array Functions in VBA
I have a loop in VBA to contour plot temperature data with an array function interpolation. How do I evaluate (Shift-Cntl-Enter) the array inside the macro?
' Run the video by selecting the rows of data
For I = IMin To IMax Step IStep
Sheets("Setup").Cells(21, 4) = I ' Update row # of data
Sheets("Calc").Application.Evaluate ("C3") ' Attempt to evaluate
' =GRIDXYZ(Setup!$B$2:$C$16,Setup!$D$2:$D$16,Calc!$C$2:$G$2,Calc!$B$3:$B$7)
Sheets(Cht(Text9)).Activate ' Show graph with new data
ActiveChart.Shapes("Text Box 4").Select ' Update the current time
Selection.Characters.Text = (I) & " " & Text0
ActiveChart.ChartArea.Select
delay (MsDelay) ' Time delay routine
Next I
rjarrett62 I don't know if GRIDXYZ (a function from an add-in) can be used in Evaluate.
Try
Sheets("Calc").Application.Evaluate("=GRIDXYZ(Setup!$B$2:$C$16,Setup!$D$2:$D$16,Calc!$C$2:$G$2,Calc!$B$3:$B$7)")