Why does this work?
The first instance is a copy. When you copy a bunch of cells all you need to
do is to point to the single upper left cell where you would like to paste
the results and the paste will paste the entire copied range, starting at
that cell. Good so far? The next line is changing what was copied to values.
In this case we take the values of the entire range and want to put them back
in the same range. This is not a copy. You are making an array of the values
in the cells and putting that array into the range that it came from... That
is it in a nut shell...
--
HTH...
Jim Thomlinson
"Brad" wrote:
This works correctly
With Sheets("Running total")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Cells(LastRow, "B").Resize(1, 28).Copy .Cells(LastRow + 1, "B")
.Cells(LastRow, "B").Resize(1, 28).Value = .Cells(LastRow,
"B").Resize(1, 28).Value
End With
Why do I need the resize (1, 28) twice on the last line to change the
equations to values? But on the second line - I don't need it.
Confused - can someone shed some light on the subject. Or if there is a
better way to range value - please let me know.
|