+ Reply to Thread
Results 1 to 3 of 3

Deleting Row and Keeping just care data

  1. #1
    Registered User
    Join Date
    01-11-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    31

    Deleting Row and Keeping just care data

    This code looks for a 6 digit number (data) and keeps it, along with keeping the first time the heading appears; everything else other than the first heading and the data (that is a 6 digit number) gets removed altogether (row delete). However, it keeps debugging at the row delete function. Please help, ty

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Deleting Row and Keeping just care data

    My gut says that the For Loop needs to be going backwards, as it is likely getting tripped up on an "I" (row) value that no longer exists because of a previous deletion. It's really tough to say without seeing at least an example. Can you potentially post a sample workbook stripped of sensitive information?
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Deleting Row and Keeping just care data

    May be this...

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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