View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Why does this work?

Because the resize determines the size of the range being acted upon. In the
first instance, copy only needs to know the size of the source range, it
will map that onto a similar sized target range. But the second instance is
simulating pastespecdial values, it needs to know the size of the source
range and the target range, otherwise it would not map correctly. For
instance

.Cells(LastRow, "B").Resize(1, 28).Value = .Cells(LastRow,
"B").Value

would copy the value of the first cell in that range to every cell in the
range, not what is wanted.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Brad" wrote in message
...
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.