+ Reply to Thread
Results 1 to 5 of 5

deleting NA

  1. #1
    Registered User
    Join Date
    02-16-2008
    Posts
    11

    deleting NA

    I need to have excel run a macro that will delete the entire row if there is a text "N/A" in a any cells that are in columns C through O. I know that this can be done via a loop...but is there an efficient way of doing this? The data set is 2000 rows

    thanks,

    j

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: deleting NA

    Hi,

    You don't really need a macro. Just use a helper column and in say A1 use

    Please Login or Register  to view this content.
    Copy this down all 2000 rows and filter on column A for the value 1. Then select all these rows and delete them.

    Of course a macro could perform exactly the same thing but if this is a one off exercise it's quicker just to do it.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-16-2008
    Posts
    11

    Re: deleting NA

    thank you!!

    john

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: deleting NA

    Agree with Richard, but as I was working on the code I'll post what I have.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Registered User
    Join Date
    02-16-2008
    Posts
    11

    Re: deleting NA

    thanks for the counif idea. it works great. the countif function is in column AB. Is there a simple vba macro that would delete the entire row if there is a value of 1 in the Column AB? the reason i need the macro is b/c i have to apply this to many sheets.



    j

+ 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