Problem copying a formulaarray into a sheet with VBA

ernie37

New Member
Joined
Jun 26, 2014
Messages
43
This one has me buffaloed. Here is the VBA to multiply two (computed) columns together and then copy the formula across the row:

Worksheets("Portfolio").ActivateRange(Cells(counter + 6, 5), Cells(counter + 6, 5)).Select
Selection.FormulaArray = "= SUM(R[-" & (counter + 2) & "]C4:R[-3]C4 * R[-" & _
(counter + 2) & "]C:R[-3]C)"
Selection.Copy
Range(Cells(counter + 6, 6), Cells(counter + 6, 12)).PasteSpecial xlPasteFormulas

What happens is the formula gets created in the correct row of the Portfolio sheet as desired, EXCEPT that R6C6 (the first pasted value) gives the same answer as R6C5. The other pasted values are fine. If I go to the sheet, copy the formula in R6C5, then do a ctrl-shift-return paste into R6C6, it does the right calculation. I have tried FillRight, I have tried everything, and I cannot seem to make that first copied cell behave.

All of the formulas look correct when examined, i.e., when you look at them in the Portfolio sheet. What is happening is the pasted formula for some reason is not getting pasted as a proper formula. Why would just that first pasted value be incorrect???? Ideas appreciated!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
[SOLVED] This was a weird one. I had turned off automatic calculations. For some reason, ONLY this column of cells was not getting recalculated. Once calculations were forced or turned back on, it works.
 
Upvote 0

Forum statistics

Threads
1,224,392
Messages
6,178,322
Members
452,841
Latest member
GenAkaman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top