+ Reply to Thread
Results 1 to 4 of 4

Inserting Blank Rows in a list of existing data to "group" it

Hybrid View

  1. #1
    Registered User
    Join Date
    10-29-2014
    Location
    Alabama
    MS-Off Ver
    2010
    Posts
    5

    Inserting Blank Rows in a list of existing data to "group" it

    Hello All,

    Very new to VBA, but am working on a project that involves several thousand lines of Excel Data. This data has to be input into another ancient system for which the input capability is 18 lines. They require that when we supply the data, it is in groups of 18 to expedite their input.

    I'm trying to find a very simple formula that starts at the first row of data and will input a blank row after every 18 rows. Any assistance will be appreciated! Many of the VBA codes I have tried to use insert to the very bottom row, almost in a do-loop, regardless of if it has data or not.

    The code I'm currently trying to use is

    Sub insert()
    m = Range("a1").CurrentRegion.Rows.Count
    For i = m To 2 Step -18
    Cells(i, 1).EntireRow.insert
    Next
    End Sub

    but it isn't counting in increments of 18 as there are small groups (2 and 3 rows) of data on both the front and tail end of the data set.

    Thanks!

  2. #2
    Registered User
    Join Date
    06-25-2014
    Location
    Budapest, Hungary
    MS-Off Ver
    2007
    Posts
    40

    Re: Inserting Blank Rows in a list of existing data to "group" it

    Sub Insert_row()
    With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
    End With
    Dim last As Integer
    last = Cells(Rows.Count, 1).End(xlUp).Row
    For i = 19 To last Step 19
    Cells(i, 1).EntireRow.insert
    
    Next
    With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
    End With
    End Sub

  3. #3
    Registered User
    Join Date
    10-29-2014
    Location
    Alabama
    MS-Off Ver
    2010
    Posts
    5

    Re: Inserting Blank Rows in a list of existing data to "group" it

    You have my thanks, worked beautifully.

  4. #4
    Registered User
    Join Date
    06-25-2014
    Location
    Budapest, Hungary
    MS-Off Ver
    2007
    Posts
    40

    Re: Inserting Blank Rows in a list of existing data to "group" it

    yw, ty for feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy Rows with "Closed" in Cell to the bottom of the existing data in Sheet5
    By Baxterma in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2014, 10:30 AM
  2. Replies: 4
    Last Post: 01-27-2012, 10:57 PM
  3. Replies: 0
    Last Post: 10-13-2011, 05:51 AM
  4. Replies: 0
    Last Post: 10-12-2011, 08:25 AM
  5. Inserting country code "1" into an existing column of phone numbers
    By Snowyky in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 03-18-2008, 06:06 PM

Tags for this Thread

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