View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CellShocked CellShocked is offline
external usenet poster
 
Posts: 277
Default Keeping formulas on an insert

Hey folks.

I have a macro where I select a whole row, and the insert it at a
location. There are formulas above and below the insertion.
the copied row has the formula, but it fails to carry on the paste.

I think maybe all I need to do is add some declaration in the insert
line to grab it as well or...

Anyway, here is the code snip.

Sub ProgAdd()
'
' ProgAdd Macro
' Insert a line within a named range for the Program Listing

Sheets("Programs").Select
Range("WOLineAdd").Select
Selection.Copy
Range("NewProgLine").Select
Selection.Insert Shift:=xlDown
End Sub

The "NewProgLine" select an entire row at the bottom of the 'table'.
This makes the insertion within a previously defined range.

One of the cells has a formula in it.

So, I guess what I really want is a "copy" and then an "Insert copied
Cells" coding to carry everything that copied row contains.