Insert Blank Rows Above another

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I need to insert 'x" number of rows above row(t)

How would I code this?

Here is my code so far ...

Rich (BB code):
fnlrow = Application.Match("Please use reverse for comments.", .Range("A:A")) + 1 'the final row of the report
            add_rows = 52 - fnlrow 'the number of blank rows needing insertion to fill up the page
            fmacnt = Application.CountA(.Range("C" & bmk + 3 & ":C" & fnlrow - 1)) + 2 'how many rows in the bottom grid
            If fmacnt < 10 Then 'the bottom grid must be a minimum 10 rows. 
                fma_rows = 10 - fmacnt 'the number of empty rows to  be inserted to bring the row count to 10 in the lower gridt
           
                'insert fma_rows above the last row of the lower grid = fnlrow-1
                
            Else

Hope I was able to explain myself OK.
 

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.
I need to insert 'x" number of rows above row(t)
I am not sure what all those calculation were about; give this single line of code a try and see if it does what you want (it inserts 10 blank rows "above" the Row 't')...

Rows(t).Resize(10).Insert
 
Last edited:
Upvote 0
Hi Rick ...

With a bit of tweaking, this is exactly what I was needing.

Thank you :-)

Jenn
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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