+ Reply to Thread
Results 1 to 3 of 3

Find data and delete remaining rows (For each loop)

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Find data and delete remaining rows (For each loop)

    In the code below I find rows containing "$$ #" at the far left and process it.
    For all the remaining rows I want to delete the entire row, my macro only deletes some rows.

    Obviously I am not grasping something about looping throught the rows to delete unwanted data.

    Please Login or Register  to view this content.
    Sample data:
    D(DROTAT)=ROTATE/YAXIS,180
    DEFDAT/FA(PLA_1),DAT(-A)
    $$

    $$ #901, 11d3, [-B-] Ø.2494 +.0005/-.0000
    F(CIR_2)=FEAT/CIRCLE,INNER,CART,0.0,0.0,0.0,I
    MEAS/CIRCLE,F(CIR_2),6
    $$
    D(DORIGN)=TRANS/YORIG,FA(CIR_2),ZORIG,FA(CIR_
    DEFDAT/FA(CIR_2),DAT(-B)
    $$

    $$ #917, [-C-] Ø.2494 +.0005/-.0000
    F(CIR_3)=FEAT/CIRCLE,INNER,CART,0.0,7.5179,-6
    MEAS/CIRCLE,F(CIR_3),6
    (Truncated for your reading pleasure.)

    All of the data in BOLD should be deleted.

    And what is with all the goofy text resizing on this site?
    Last edited by Rick_Stanich; 04-24-2009 at 11:45 AM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find data and delete remaining rows (For each loop)

    When you're deleting, you need to loop through the rows backwards using a row variable, rather than a for-each loop. Think about it ...
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Find data and delete remaining rows (For each loop)

    Thanks shg!

    Sometimes I just need a little direction. :D
    Please Login or Register  to view this content.

+ 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