+ Reply to Thread
Results 1 to 8 of 8

Delete entire row if the cell does not contain a set of different numbers (please help)

  1. #1
    Registered User
    Join Date
    06-03-2020
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    14

    Question Delete entire row if the cell does not contain a set of different numbers (please help)

    Hi guys,

    I have a bunch of SCR files used for AutoCAD which I modify with Excel, please refer to the picture below:

    Script Excel.png

    The script has been trimmed for easier viewing, I'm trying to keep the rows which has the numbers shown in red ( .6. / .3. / .2. ),

    I know this can be done manually by search all > select all rows that are needed > copy and paste, but I have a large number of scripts to handle everyday so I would like to do this with VBA.

    My script below will only let me keep ( .6. ), how could this be modified so that it will keep all rows containing all 3 numbers at the same time ?

    -------------------------------------------------------------------------------------------------------------------
    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------

    Please help, thanks in advance !!
    Last edited by blackragon; 06-20-2020 at 03:35 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,908

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Code Tags Added
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-03-2020
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    14

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Hi Alan, Sorry for the mistake,

    Thanks for adding, will be sure to look out in the future

  4. #4
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Sorry if I'm not helping here,
    just want to know more about your situation...

    Quote Originally Posted by blackragon View Post
    I'm trying to keep the rows which has the numbers shown in red ( .6. / .3. / .2. )
    Will the value .6. / .3. / .2. stay the same forever ?
    I mean whenever you open the workbook, the rows to keep will always the row which has the numbers shown in red ( .6. / .3. / .2. ).

    or it not stay the same forever ? for example:
    sometimes maybe you want to keep the row which has the numbers .2. / .1. / .0.
    other time maybe you want to keep the row which has the numbers .0. / .3. / .1.
    other time maybe you want to keep the row which has only the number .6.

    Thank you.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,553

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Untested.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-03-2020
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    14

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Hi karmapala,

    Thanks for being so kind, the post has been solved,

    your help is much appreciated )
    Last edited by blackragon; 06-20-2020 at 03:35 AM.

  7. #7
    Registered User
    Join Date
    06-03-2020
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    14

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Hi jindon,

    Thanks for the reply. I just tested it,

    Works perfect, never thought this could be done with a short and clean code like this, much appreciated.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,553

    Re: Delete entire row if the cell does not contain a set of different numbers (please help

    Glad it worked and thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF cell contains * or * delete entire Row
    By 3345james in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-18-2018, 01:20 PM
  2. [SOLVED] Delete entire row in table if cell in column P contains any value (numbers or text)
    By BuntyMac in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-29-2016, 02:49 PM
  3. VBA code to delete the FILTERED range and moving the cell up (dont Delete entire row)
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2015, 07:48 AM
  4. [SOLVED] Delete Entire Row if cell contains specified value
    By kosti in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2015, 07:39 AM
  5. [SOLVED] Delete cell only with certain critria. Don't want to delete entire row, the celsl only
    By RobertOHare in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2013, 04:18 AM
  6. IF cell contains value - delete entire row
    By Chris2010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2010, 10:44 PM
  7. Delete entire row when cell says delete
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-27-2007, 11:46 AM

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