How to add a new line without breaking formulas?

norolemodelz

New Member
Joined
Sep 21, 2018
Messages
1
Hi everyone. I need to add a new blank line between the selected rows for the project plan. Almost every cell has formulas, and this new line must be the same. How can I handle without mess?




WhatsAppImage2018-09-20at18.40.55.jpg
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Here is VBA solution

Test this on a copy of your worksheet - new row created in row below the active cell

With the cursor in G5
- inserts new row in row 6
- formulas and formats copied from row5 to row 6

Put in a standard code module
Code:
Sub InsertRowBelowActiveCell()
  Dim rng As Range, cel As Range
  Set cel = ActiveCell

  With cel
    Set rng = .EntireRow.SpecialCells(xlCellTypeFormulas)
    .Offset(1).EntireRow.Insert Shift:=xlDown
    .EntireRow.Copy
    .Offset(1).EntireRow.PasteSpecial xlPasteFormats
    rng.Copy rng.Offset(1)
  End With

  Application.CutCopyMode = False
End Sub

I have no idea what will happen with your merged cells - test and see if it works.
Merged cells may cause problems that cannot be easily resolved - including code refusing to run.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,080
Messages
6,128,692
Members
449,464
Latest member
againofsoul

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top