Size of arrayformula with VBA
Bob,
Thank you! That was exactly what I eas trying to do!
/Sune
"Bob Phillips" wrote:
Do you mean
Dim iLastRow As Long
Dim iLastCol As Long
With Worksheets("Ark")
iLastRow = .Cells.Find(What:="*", _
After:=.Range("A1"), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
iLastCol = .Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
End With
Range("A2", Worksheets("Sheet1").Cells(iLastRow, iLastCol)).FormulaArray
= _
"=IF(Ark1!RC:R[" & iLastRow & "]C[" & iLastCol & _
"]="""","""",Ark1!RC:R[" & iLastRow & "]C[" & iLastCol & "])"
|