Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2013
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move to multiple rows and copy adjacent cell down

    Hi,

    I am trying to move data that is after Column J to Column D insert new row and if required create multiple rows.
    Also copy the adjacent Column A,B & C to each new row.
    I have attached a sample spreadsheet, I prefer to do this with a Macro.
    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    3 Star Lounger Supershoe's Avatar
    Join Date
    Apr 2014
    Location
    Austin, TX
    Posts
    252
    Thanks
    1
    Thanked 36 Times in 34 Posts
    'Could be better but works

    Option Explicit
    Sub LineEmUpSAS()
    Dim i As Long
    Application.ScreenUpdating = 0
    i = 1
    Do Until IsEmpty(Cells(i, 1))
    If Len(Application.Trim(Cells(i, 4))) <> 0 Then
    Rows(i + 1).Insert
    Range("a" & i & ":c" & i & ",k" & i & ":z" & i).Copy Cells(i + 1, 1)
    End If
    i = i + 1
    Loop
    'clean up
    Columns("d").SpecialCells(xlCellTypeBlanks).Entire Row.Delete
    Columns("k").Resize(, 20).Delete
    Application.ScreenUpdating = 1
    End Sub

  3. #3
    New Lounger
    Join Date
    Sep 2013
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks dguillett, You have saved me from hardship.

    Many Thanks.

Posting Permissions

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