I created a string formula in the macro to calculate the sum. This
formula includes a reference to a cell, not in the Range, that contains
the row number of the cell that is adjacent above the cell (the Active
Cell) that is to contain the sum formula.
This is the line of code: ActiveCell.FormulaR1C1 = " = ""=sum(J3:J"" &
R[4]C & "")"" " (SPACES ADDED FOR CLARITY). The cell containing the Row
number is 4 rows belows the cell to contain the sum formula.
The macro then does a copy, pastespecial, values on the Active Cell and
the above formula is calculated to be =sum(J3:J23) (ASSUMING THAT 23 IS
THE ROW NUMBER IMMEDIATELY ABOVE THE ACTIVE CELL). Having the macro do
another copy, pastespecial, values on this cell has zero effect.
I tried using Application.SendKeys "{F2}~", but it only wants to open
the Object Browser. If I click on the WorkSheet, key {F2}, then key
{ENTER}, the formula is calculated and the cell displays the numerical
result.
What am I doing wrong?
Chuckles123
--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:
http://www.excelforum.com/member.php...o&userid=14948
View this thread:
http://www.excelforum.com/showthread...hreadid=265814