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 452595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:05:18+00:00 2026-05-12T22:05:18+00:00

I have an excel 2007 worksheet open with 5 colums and +/-5000 rows of

  • 0

I have an excel 2007 worksheet open with 5 colums and +/-5000 rows of data.

What I want to do is create a macro that will:

  1. insert 3 blank rows under each record
  2. copy the value in that row on column 1 and paste it in the 3 new rows in column 1
  3. CUT the value from column 3 and place it in the first blank row beneath it in column 2
  4. CUT the value from column 4 and place it in the next blank row beneath it in column 2
  5. CUT the value from column 5 and place it in the next blank row beneath it in column 2

I am pulling out my hair trying to accomplish this but to no avail! please could someone assist me with this?

Much thanks

  • 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-05-12T22:05:18+00:00Added an answer on May 12, 2026 at 10:05 pm

    Try something like this

    Sub Macro1()
    Dim range As range
    Dim i As Integer
    
    Dim RowCount As Integer
    Dim ColumnCount As Integer
    Dim sheet As worksheet
    Dim tempRange As range
    Dim valueRange As range
    Dim insertRange As range
    
        Set range = Selection
        RowCount = range.Rows.Count
        ColumnCount = range.Columns.Count
        For i = 1 To RowCount
            Set sheet = ActiveSheet
    
            Set valueRange = sheet.range("A" & (((i - 1) * 4) + 1), "E" & (((i - 1) * 4) + 1))
    
            Set tempRange = sheet.range("A" & (((i - 1) * 4) + 2), "E" & (((i - 1) * 4) + 2))
            tempRange.Select
            tempRange.Insert xlShiftDown
            Set insertRange = Selection
            insertRange.Cells(1, 1) = valueRange.Cells(1, 1)
            insertRange.Cells(1, 2) = valueRange.Cells(1, 3)
            valueRange.Cells(1, 3) = ""
    
            Set tempRange = sheet.range("A" & (((i - 1) * 4) + 3), "E" & (((i - 1) * 4) + 3))
            tempRange.Select
            tempRange.Insert xlShiftDown
            Set insertRange = Selection
            insertRange.Cells(1, 1) = valueRange.Cells(1, 1)
            insertRange.Cells(1, 2) = valueRange.Cells(1, 4)
            valueRange.Cells(1, 4) = ""
    
            Set tempRange = sheet.range("A" & (((i - 1) * 4) + 4), "E" & (((i - 1) * 4) + 4))
            tempRange.Select
            tempRange.Insert xlShiftDown
            Set insertRange = Selection
            insertRange.Cells(1, 1) = valueRange.Cells(1, 1)
            insertRange.Cells(1, 2) = valueRange.Cells(1, 5)
            valueRange.Cells(1, 5) = ""
    
        Next i
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel 2007 workbook that contains tables of data that I'm importing
Using Windows XP and Excel 2007 I have a worksheet with a macro in
I have an Excel 2007 workbook that contains an ODBC data connection (to FoxPro,
I have an access 2007 Database that outputs a report in excel format, the
I have a macro-enabled worksheet that resides in a shared location on my PC.
I have the following macro which needs to loop though an Excel-2007 table. The
I have a TreeView in excel 2007 with checkboxes. I want the checkboxes to
I have a web page which links to an Excel 2007 worksheet. It is
I have written a macro in excel 2007 to log water-level readings. Once logged,
Currently, I have the following method that writes to excel 2007. public static void

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.