Closed Thread
Results 1 to 3 of 3

[SOLVED] Insert blank rows repeatedly between every data row in Excel

  1. #1
    Cool
    Guest

    [SOLVED] Insert blank rows repeatedly between every data row in Excel

    Could you guide me please....

    I need to insert 5 blank rows repeatedly between every existing data rows
    for approximately 300 rows.

    If I go about doing the repeat short-cut "Control+Y", it just repeats
    inserting ONE row only between the consecutive data row.

    Is there some command, which helps me highlight all the rows & allows me to
    insert 5 blank rows between every consecutive existing data row?

    Thanks in advance for your kind advice.

  2. #2
    Registered User
    Join Date
    12-31-2005
    Posts
    13

    Repetative Inserting of Rows

    Hi

    Being very new to excel coding, this code might be lengthy, but it works.

    Please Login or Register  to view this content.

    Hope this suffice your cause.

    SAS
    Last edited by Simon Lloyd; 11-01-2007 at 03:36 AM.

  3. #3
    JMay
    Guest

    Re: Insert blank rows repeatedly between every data row in Excel

    The 7 lines of code you have between the For Line and the Next line can be
    replaced with the following 3 lines of code:

    Please Login or Register  to view this content.
    ''' Just one alternative,,,
    FWIW...


    "abcdexcel" <abcdexcel.21d7o0_1136806204.5255@excelforum-nospam.com> wrote in
    message news:abcdexcel.21d7o0_1136806204.5255@excelforum-nospam.com...
    >
    > Hi
    >
    > Being very new to excel coding, this code might be lengthy, but it
    > works.
    >
    > Public Sub insert_row()
    > Const TestColumn As Long = 1 'have taken column A as 1, thus B would be
    > 2'
    > Dim cRows As Long
    > Dim i As Long
    >
    > cRows = Cells(Rows.Count, TestColumn).End(xlUp).Row
    > For i = cRows To 2 Step -1
    > If Cells(i, TestColumn).Value <> IsNotBlank Then
    > Cells(i, TestColumn).EntireRow.Insert
    > Cells(i, TestColumn).EntireRow.Insert
    > Cells(i, TestColumn).EntireRow.Insert
    > Cells(i, TestColumn).EntireRow.Insert
    > Cells(i, TestColumn).EntireRow.Insert
    > End If
    > Next i
    >
    > End Sub
    >
    >
    > Hope this suffice your cause.
    >
    > SAS
    >
    >
    > --
    > abcdexcel
    > ------------------------------------------------------------------------
    > abcdexcel's Profile:
    > http://www.excelforum.com/member.php...o&userid=30021
    > View this thread: http://www.excelforum.com/showthread...hreadid=499280
    >
    Last edited by Simon Lloyd; 11-01-2007 at 03:36 AM.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1