I have a pretty neat code I use to insert a row and it copies the formulas from the row below and pastes them into the new inserted row. It then clears contents of the new row. However, IF there are no contents in that row it copied, I get an error that says "No cells were found". Is there a way to modify the code below to not get this error message when the row it copies doesn't have contents? (the reason I have this code is in order to copy formulas into the new row)
Sub AddNewRow()
ActiveCell.EntireRow.Select
Selection.Copy
Selection.Insert
Application.CutCopyMode = False
ActiveCell.EntireRow.SpecialCells(xlCellTypeConstants).ClearContents
End Sub
Sub AddNewRow()
ActiveCell.EntireRow.Select
Selection.Copy
Selection.Insert
Application.CutCopyMode = False
ActiveCell.EntireRow.SpecialCells(xlCellTypeConstants).ClearContents
End Sub
Last edited: