Delete rows NOT followed by blank cells.

  • Hi guys,


    I have my data in the following format and I want to keep the rows in green, so delete all rows where the value in column 1 of the following row is not blank. [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 155, align: right"]212345[/TD]
    [TD="width: 259"]AB[/TD]
    [TD="width: 15"]6[/TD]
    [TD="width: 19"] [/TD]
    [TD="width: 250"] [/TD]

    [/tr]


    [tr]


    [TD="align: right"]231354[/TD]

    [td]

    CD

    [/td]


    [td]

    5

    [/td]


    [td]

    A

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]64685[/TD]

    [td]

    EF

    [/td]


    [td]

    6

    [/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="align: right"]465321[/TD]

    [td]

    GH

    [/td]


    [td]

    5

    [/td]


    [td]

    G

    [/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]546746853[/TD]

    [td]

    IJ

    [/td]


    [td]

    5

    [/td]


    [td]

    K

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]465464[/TD]

    [td]

    KL

    [/td]


    [td]

    6

    [/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="align: right"]54645[/TD]

    [td]

    MN

    [/td]


    [td]

    6

    [/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="align: right"]446843541[/TD]

    [td]

    OP

    [/td]


    [td]

    5

    [/td]


    [td]

    A

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]584683[/TD]

    [td]

    QR

    [/td]


    [td]

    6

    [/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [TD="align: right"]54654354[/TD]

    [td]

    ST

    [/td]


    [td]

    5

    [/td]


    [td]

    F

    [/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]435454[/TD]

    [td]

    UV

    [/td]


    [td]

    5

    [/td]


    [td]

    A

    [/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    LMOP

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    D

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]5485435[/TD]

    [td]

    WX

    [/td]


    [td]

    5

    [/td]


    [td]

    D

    [/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]46546[/TD]

    [td]

    YZ

    [/td]


    [td]

    5

    [/td]


    [td]

    K

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]346543[/TD]

    [td]

    AC

    [/td]


    [td]

    5

    [/td]


    [td]

    F

    [/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [/TABLE]
    This is the code I have but it doesn't seem to be doing what I want, appreciate if someone could tell me what I am doing wrong:



    Thanks in advance!!
    Amruta

  • If you want keep green text

  • That's rather confusing. Could you possibly attach a workbook showing 'before' and 'after' please?


    Hi Stephen,


    Sorry about the confusion.


    The outcome needs to be this: [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 72, align: right"]435454[/TD]
    [TD="width: 72"]UV[/TD]
    [TD="width: 72, align: right"]5[/TD]
    [TD="width: 72"]A[/TD]
    [TD="width: 72"]DHFL[/TD]

    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    LMOP

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    D

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]46546[/TD]

    [td]

    YZ

    [/td]


    [TD="align: right"]5[/TD]

    [td]

    K

    [/td]


    [td]

    ACEG

    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td]

    DHFL

    [/td]


    [/tr]


    [/TABLE]

  • If you want keep green text


    Sorry, doesn't seem to do anything. :(


    Thanks for trying, appreciate that.

  • Hello,


    You should carefully read StephenR's recommendation ...


    Quote

    That's rather confusing. Could you possibly attach a workbook showing 'before' and 'after' please?

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!