+ Reply to Thread
Results 1 to 2 of 2

Insert Row When Column Amount Changes

  1. #1
    Ronald \Tony\ Johnson
    Guest

    Insert Row When Column Amount Changes

    Here is an example of what I am talking about.

    A B C D
    1 A B C D
    2 2 41100 274 584
    3 2 41100 274 625
    4 2 41100 274 333
    5 2 41100 274 102
    6 2 41100 274 957
    7 2 41100 274 362
    8 2 41100 274 651
    9 2 41100 274 611
    10 2 41100 284 965
    11 2 41100 284 336
    12 2 41100 284 251
    13 2 41100 284 362
    14 2 41100 284 859
    15 2 41100 284 512
    16 2 41100 284 669
    17 2 41100 284 512


    I need to insert a new row every time the amount in Column "C"
    changes to a different amount than the previous one.
    There are approx 16,000 rows in this file or I would not be asking..lol

    Thanks for any help you can offer.


    --
    Tony Johnson

    --
    Tony Johnson

  2. #2
    Don Guillett
    Guest

    Re: Insert Row When Column Amount Changes

    try this

    Sub insertrowifdifferent()
    For i = Cells(Rows.Count, "c").End(xlUp).Row To 2 Step -1
    If Cells(i - 1, 3) <> Cells(i, 3) Then Rows(i).Insert
    Next
    End Sub

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Ronald "Tony" Johnson" <tonyj1965@email.wintu.edu> wrote in message news:uUPnjtEUFHA.2172@TK2MSFTNGP10.phx.gbl...
    Here is an example of what I am talking about.

    A B C D
    1 A B C D
    2 2 41100 274 584
    3 2 41100 274 625
    4 2 41100 274 333
    5 2 41100 274 102
    6 2 41100 274 957
    7 2 41100 274 362
    8 2 41100 274 651
    9 2 41100 274 611
    10 2 41100 284 965
    11 2 41100 284 336
    12 2 41100 284 251
    13 2 41100 284 362
    14 2 41100 284 859
    15 2 41100 284 512
    16 2 41100 284 669
    17 2 41100 284 512


    I need to insert a new row every time the amount in Column "C"
    changes to a different amount than the previous one.
    There are approx 16,000 rows in this file or I would not be asking..lol

    Thanks for any help you can offer.


    --
    Tony Johnson

    --
    Tony Johnson

+ Reply to 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