PDA

View Full Version : Solved: Insert blank row, NOT "insert copied cells"



crowfan
07-18-2008, 07:58 AM
Hello,

I am trying to write a bit of code that will insert a BLANK row below the active cell.

The problem I am running into is that Excel seems to be using the "Insert Copied Cells" function if it is available. So instead of a blank row, I get a row filled with data pasted over and over again. If I've recently copied something to the clipboard, and the "Insert Copied Cells" function is available, it will use that, and will add a row filled with the data I just copied. Subsequent uses of the macro will yield a blank row, because the "Insert Copied Cells" function is not available any longer. I need it to insert a BLANK row EVERY time.

I've tried EntireRow.Insert and Rows.Insert and both do the same thing.

Any ideas?

Thanks!

mdmackillop
07-18-2008, 10:13 AM
I can't replicate it but try

Sub Ins()
Application.CutCopyMode = False
ActiveCell.EntireRow.Insert
End Sub

crowfan
07-18-2008, 10:50 AM
CutCopyMode did it. Thanks!