ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programmatically copying array formulas (https://www.excelbanter.com/excel-programming/415469-programmatically-copying-array-formulas.html)

Barb Reinhardt

Programmatically copying array formulas
 
It appears when I programmatically copy an array formula using something like
this:

r.formular1c1 = r.offset(-1,0).formular1c1 'where r is a range.

The array formulas need to be committed with CTRL SHIFT ENTER. Is this
happening to anyone else? What do I need to do to get these to copy
correctly?

FWIW, I'm still using 2003.
Thanks,
Barb Reinhardt


Mike H

Programmatically copying array formulas
 
Try,

r.FormulaArray = r.Offset(-1, 0).FormulaArray

Mike

"Barb Reinhardt" wrote:

It appears when I programmatically copy an array formula using something like
this:

r.formular1c1 = r.offset(-1,0).formular1c1 'where r is a range.

The array formulas need to be committed with CTRL SHIFT ENTER. Is this
happening to anyone else? What do I need to do to get these to copy
correctly?

FWIW, I'm still using 2003.
Thanks,
Barb Reinhardt


Barb Reinhardt

Programmatically copying array formulas
 
Is there some way to determine if I need to use FormulaArray
programmatically. For now, I'm just doing it on certain columns.
Thanks,
Barb Reinhardt



"Mike H" wrote:

Try,

r.FormulaArray = r.Offset(-1, 0).FormulaArray

Mike

"Barb Reinhardt" wrote:

It appears when I programmatically copy an array formula using something like
this:

r.formular1c1 = r.offset(-1,0).formular1c1 'where r is a range.

The array formulas need to be committed with CTRL SHIFT ENTER. Is this
happening to anyone else? What do I need to do to get these to copy
correctly?

FWIW, I'm still using 2003.
Thanks,
Barb Reinhardt


Mike H

Programmatically copying array formulas
 
Hi,

If r.HasArray Then
'copy array style
else
'copy non array style
end if

Mike

"Barb Reinhardt" wrote:

Is there some way to determine if I need to use FormulaArray
programmatically. For now, I'm just doing it on certain columns.
Thanks,
Barb Reinhardt



"Mike H" wrote:

Try,

r.FormulaArray = r.Offset(-1, 0).FormulaArray

Mike

"Barb Reinhardt" wrote:

It appears when I programmatically copy an array formula using something like
this:

r.formular1c1 = r.offset(-1,0).formular1c1 'where r is a range.

The array formulas need to be committed with CTRL SHIFT ENTER. Is this
happening to anyone else? What do I need to do to get these to copy
correctly?

FWIW, I'm still using 2003.
Thanks,
Barb Reinhardt



All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com