+ Reply to Thread
Results 1 to 6 of 6

Delete rows containing a number

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    35

    Delete rows containing a number

    hi
    I need Automatic delete any rows which containing number starting with 333
    Example
    A1 : 333456789
    A2 : 4567865555
    A3 : 333 9876577
    A4 : 3376879800

    Become
    A1 : 4567865555
    A2 : 3376879800
    Thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete rows containing a number

    you could auto filter,custom,begins with 333 then delete the rows shown
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Delete rows containing a number

    hesham63,

    With your raw data in column A beginning in cell A1.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.

    Then run the Delete333Rows macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    04-28-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Delete rows containing a number

    Thank you very much
    Is it possible to automatically delete rows when writing

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Delete rows containing a number

    hesham63,


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Then make entries in column A. And, after you press the ENTER key, or select one of the arrow keys to navigate, if the first three characters of what you typed in is 333, then the row will get deleted.

  6. #6
    Registered User
    Join Date
    04-28-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    35

    Re: Delete rows containing a number

    Thank you very much

+ 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