N
NewsMan
I have a spreadsheet where I need to continue to add new rows. I want
to be able to copy a row with all the formulas intact, but none of the
values that may be in the row being copied. For example, if I have my
cursor on row 1, which may already contain values, I want to be able to
copy Row 1 to Row 2 with the formuals, but not values that may already
be in Row 1. Here is my VBA code. It copies and inserts a new row and
the formulas, but it will also include any values. Any suggestions?
Sub Insert_Row()
Dim rnRow As Range
Application.ScreenUpdating = True
Set rnRow = ActiveCell
rnRow.EntireRow.Select
With rnRow
..Copy
..Offset(-1, 0).PasteSpecial (xlPasteFormulas)
End With
With Application
..CutCopyMode = False
..ScreenUpdating = False
End With
End Sub
to be able to copy a row with all the formulas intact, but none of the
values that may be in the row being copied. For example, if I have my
cursor on row 1, which may already contain values, I want to be able to
copy Row 1 to Row 2 with the formuals, but not values that may already
be in Row 1. Here is my VBA code. It copies and inserts a new row and
the formulas, but it will also include any values. Any suggestions?
Sub Insert_Row()
Dim rnRow As Range
Application.ScreenUpdating = True
Set rnRow = ActiveCell
rnRow.EntireRow.Select
With rnRow
..Copy
..Offset(-1, 0).PasteSpecial (xlPasteFormulas)
End With
With Application
..CutCopyMode = False
..ScreenUpdating = False
End With
End Sub