View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Carl LaFong Carl LaFong is offline
external usenet poster
 
Posts: 19
Default Automating copy/paste/paste special when row references change


"Joel" wrote in message
...
The code assumes Column B if filled in for every row. the code uses this
column to determine last row. It also looks like you code was pasting
twice.
I simplified the original code

Sub Macro2test()
'
' Macro2test Macro
' yada yada
'
' Keyboard Shortcut: Ctrl+f
'
Lastrow = Cells(Rows.Count, "B").End(xlUp).Row

Range("B" & Lastrow & ":W" & Lastrow).Copy
Range("B" & (Lastrow + 1)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub



Joel:

Thanks for the help.

I am guessing I didn't explain myself well enough in my original post.

You state "It also looks like you code was pasting twice". That is correct
and I need to paste twice.

The first paste must paste the formulas to the next row down.

The second paste must paste the raw values (not the formulas) back to the
source row.

I tried your code. It pastes the formulas down to the correct row, but does
NOT then also paste the values back to the source row, overwriting the
formulas. I need that to happen. The macro must leave the formulas ONLY in
the very last row, so it must overwrite the original row, which becomes the
next to last row after the formulas are pasted down.

In the meantime, I will fiddle with your code to see if I can get it to work
as required.

Thanks again.