+ Reply to Thread
Results 1 to 15 of 15

Adding row

  1. #1
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8

    Adding row

    Hello,

    Is it possible to add a row between every record, that has different data for 2 columns ( compared to the row below ) ?

    Thanks,
    Risto

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Post an example of the data with reference to the columns etc

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Insert row between different data

    The 2 columns are a little confusing, this will insert rows between different data in column A
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    Thanks for the help

    I attached the sample file. I would like to insert a row between records, only if columns Name & Phone have different data. If Name & Phone have the same data, no row is added.

    Risto
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    i guess i can just execute the code twice for different columns, it should do the trick.

    But is it possible to add data to these empty rows ? data from one row below, for example column A, B & C.

    Thanks,
    Risto

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Someone might take a look at you add an excel file. After all it is an excel forum!

    VBA Noob

  7. #7
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    excel file attached
    Attached Files Attached Files

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Which 2 columns. Give as much detail as possible

    VBA Noob

  9. #9
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    columns A & E.

    And then if i have these empty rows, is it possible to copy data to these rows from one row below ? For example data from columns A, B & C to the empty rows.

    Thanks for the help.
    Risto
    Last edited by RistoP; 12-15-2008 at 12:43 PM.

  10. #10
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    anyone can help me ?

  11. #11
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) Based on your example file

    Please Login or Register  to view this content.
    However, in that file there are no test examples where column A is the same, but column E is different. Also, is this data meant to be sorted beforehand.

    2) And on your previous post, what empty rows are you trying to fill? After the inserted row? Or for some missing items in the starting data?

    As VBA Noob said - give as much detail as possible.

    rylo

  12. #12
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    my mistake, forgot to change column E, so it would be different. But i tried your code and it worked perfectly. All empty rows were populated correctly
    Im not sure what you ment by sorted beforehand

    And yes, im trying to fill the inserted empty rows, with the data from one row below and from columns A, B & C

    Thank You for the help

  13. #13
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    For the fill question, can you either adjust your existing example file, or put up a new file that will match your question and show exactly what you want the completed output to look like.


    rylo

  14. #14
    Registered User
    Join Date
    12-14-2008
    Location
    Estonia
    Posts
    8
    ok, i have attached 3 files:
    sample.xls - this is the original file.
    sample-with-empty-rows.xls - this is the file, where the script is executed & the empty rows are created.
    sample-final.xls - this is the final file, the way it should be in the end. The 3 columns ( A, B, C ) from the below row, is copied to the empty rows.

    Thank You,
    Risto
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Risto

    Try this

    Please Login or Register  to view this content.
    rylo

+ 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