I have stored arrays that I want to transfer from one workbook to another. When I run the code in one workbook, it's fast and efficient. If I try to transfer the data to another workbook, it's slow as sin. The code is like this.
BillItemTypeSVC = [StoredSVC]
BillItemTypeDesc = [StoredDesc]
BillItemTypeUnits = [StoredUnits]
BillItemTypeDebit = [StoredDebit]
BillItemTypeUnitPrice = [StoredUnitPrice]
For iX = 1 To 72
With Workbooks("CAS").Sheets("BilledItems").Range("A13")
.Offset(iX, 0) = BillItemTypeSVC(iX)
.Offset(iX, 1) = BillItemTypeDesc(iX)
.Offset(iX, 2) = BillItemTypeUnitPrice(iX)
.Offset(iX, 3) = BillItemTypeUnits(iX)
.Offset(iX, 4).Value = BillItemTypeDebit(iX)
End With
Next iX
If I run this within a single workbook, the macro takes a fraction of a second. If I transfer to a new workbook, each loop takes over a second. (About 90 sec. for this macro). Any ideas why so slow?
Thanks,
Mike
BillItemTypeSVC = [StoredSVC]
BillItemTypeDesc = [StoredDesc]
BillItemTypeUnits = [StoredUnits]
BillItemTypeDebit = [StoredDebit]
BillItemTypeUnitPrice = [StoredUnitPrice]
For iX = 1 To 72
With Workbooks("CAS").Sheets("BilledItems").Range("A13")
.Offset(iX, 0) = BillItemTypeSVC(iX)
.Offset(iX, 1) = BillItemTypeDesc(iX)
.Offset(iX, 2) = BillItemTypeUnitPrice(iX)
.Offset(iX, 3) = BillItemTypeUnits(iX)
.Offset(iX, 4).Value = BillItemTypeDebit(iX)
End With
Next iX
If I run this within a single workbook, the macro takes a fraction of a second. If I transfer to a new workbook, each loop takes over a second. (About 90 sec. for this macro). Any ideas why so slow?
Thanks,
Mike