Why does this code not work for me?

P

Patrick C. Simonds

First, sorry about the double post, but realized I posted my question to the
wrong forum.


Can anyone tell me why this code not only pastes the Formulas (which I want)
but also the values in the cells?


Sub test()

Dim cellActive As Range
Set cellActive = ActiveCell


Dim rgNewRow As Range
ActiveCell.EntireRow.Insert Shift:=xlDown
Set rgNewRow = Rows(cellActive.Row - 1)


cellActive.EntireRow.Copy

rgNewRow.PasteSpecial (xlPasteFormulas)


End Sub
 
N

Nigel

It is correct, the option Formulas takes the 'formula and values' only, in
other words formatting etc, is ignored.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top