Code for inserting 300 rows

griffindor2020

New Member
Joined
Jun 6, 2020
Messages
20
Office Version
  1. 2016
Platform
  1. MacOS
Hello,

I was wondering if someone could help me develop a code to insert 300 rows after a specific row.

For example I would like to add 300 rows right after row 80 000 in my data set. :)

Hope someone will get back to me soon !
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
How about
VBA Code:
Rows(80001).Resize(300).Insert
 
Upvote 0
How did you try running it? and where did you put the code?
 
Upvote 0
Did you actually mean after row 80,000 ?
That's a lot of rows of data.
 
Upvote 0
How did you try running it? and where did you put the code?

I tried running by going into Visual Basic, then created a module and copy pasted the script that Fluff made.

Did you actually mean after row 80,000 ?
That's a lot of rows of data.

I know, I do have an insanely high volume of data :') can you imagine I was trying to sort this manually without knowing anything about macros and VBA ? :')

But yes, I need 300 rows to be inserted right after row 80 000 :) !
 
Upvote 0
Did you put it inside a sub, like
VBA Code:
Sub griffindor()
   Rows(80001).Resize(300).Insert
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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