Home > Community > Automation and VBA > Copy a matrix into excel > Antwort auf: Copy a matrix into excel

#9422
Bernhard KantzBernhard Kantz
Teilnehmer

Your code should work if you assign the value of the formula evaluation instead of the value object itself to your matrix variable.


Dim fml As Formula
Set fml = ActiveDatabase.RootFolder("Formel", fpObjectTypeFormula)
fml.Update
Dim matrix
matrix = fml.Value

Note the update of the formula before using its value.

Hint: To exchange rows and columns use Application.WorksheetFunction.Transpose(matrix) in the assignment to the range.