Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:41:41+00:00 2026-06-16T13:41:41+00:00

Possible Duplicate: Insert row every X rows in excel I have a large set

  • 0

Possible Duplicate:
Insert row every X rows in excel

I have a large set of data (let’s say it goes from B5 to J500 and let’s say this range is named rngOutput). I am trying to go through this data and add 2 empty rows every x number of rows where x is a number the user specifies. For example if x is 10 then every 10 rows 2 new rows should be inserted. Conceptually, this is the code that should work:

For i = 1 to Number of rows in rngOutput
   If i mod x = 0 Then
        Insert 2 Rows
   End If
Next i

However, when you insert 2 new rows, the row count changes and the formula messes up (i.e. it adds 2 rows after the first 10 rows, then it adds another 2 rows after the next 8 rows (since it counts those 2 new rows you added as actual rows) then it adds another 2 rows after the next 6 rows, etc.

I am trying to figure out a way to accomplish adding 2 new rows every x number of rows cleanly to avoid the above problem.

Thank you for the help and please let me know if you need additional clarification!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:41:43+00:00Added an answer on June 16, 2026 at 1:41 pm

    Count from the bottom of the range

    For i = Number of rows in rngOutput to 1 step -1
       If i mod x = 0 Then
            Insert 2 Rows
       End If
    Next i
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to insert a row between two rows in an existing excel
Possible Duplicate: Best way to get identity of inserted row? I have an INSERT
Possible Duplicate: Update row with data from another row in the same table I
I have the following insert trigger, which is essentially writing a duplicate row from
Possible Duplicate: convert MySQL SET data type to Postgres I have postgresql 8.4. I
Possible Duplicate: Fetch data in database table insert it if not exist else return
Possible Duplicate: insert multiple rows via a php array into mysql I know about
Possible Duplicate: How to use MonthCalender to insert date in text box? I have
Possible Duplicate: Which is faster: multiple single INSERTs or one multiple-row INSERT? While going
Possible Duplicate: PHP code can insert image to excel file and open it correctly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.