Insert 2 blank cells and Fill it down.
Insert 2 blank cells and Fill it down.
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Insert 2 blank cells and Fill it down.

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    How do I modify this script below (belongs to BabyTiger) to transform from this:

    WORD:
    abash
    abess
    abate

    to this:

    WORD:
    abash
    abash
    abash
    abess
    abess
    abess
    abate
    abate
    abate
    ----------------
    Range("A2").Select
    Do While Range("A2").Offset(1, 0).Value <> ""
    Range("A" & Range("A2").End(xlDown).Row & ":A" & Range("A2").End(xlDown).Row + 1).Insert Shift:=xlDown
    Loop

    ----------------

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Wellington
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Range("A2").Select
    Row_Numb = Range("A2").End(xlDown).Row
    For i = Row_Numb To 2 Step -1
    Rows(i).Copy
    Rows(i & ":" & i + 1).Insert shift:=xlDown
    Next i

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Wellington
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Range("A2").Select
    Row_Numb = Range("A2").End(xlDown).Row
    For i = Row_Numb To 2 Step -1
    Rows(i).Copy
    Rows(i & ":" & i + 1).Insert shift:=xlDown
    Next i

    (as per other thread.)

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks BabyTigerrrrrr!

  5. #5

    Join Date
    Mar 2002
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dim rng As Range, c As Long
    Application.ScreenUpdating = False
    Columns(1).Insert
    Set rng = Range([B1], [B65536].End(xlUp)).Offset(0, -1)
    c = rng.Cells.Count
    With rng
    .Cells(1, 1).Value = 1
    .Cells(1, 1).AutoFill Destination:=rng, Type:=xlFillSeries
    .Resize(, 2).Copy .Offset(c, 0).Resize(c + c, 2)
    Rows("1:" & c * 3).Sort Key1:=Range("A1")
    .EntireColumn.Delete
    End With

    (As per other thread)

  6. #6

    Join Date
    Mar 2002
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Just by way of mote :-

    Whether you use a macro that uses a loop (like BabyTiger's) or a macro that avoids a loop (like mine) depends upon how much data you have to be processed and how important the process time is.

    With 3000 lines of data, BabyToger's macro takes 34 seconds to run; the run time for the macro without a loop is not recordable (less than 1 second).

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com