+ Reply to Thread
Results 1 to 7 of 7

Another Deleting Rows that do not Contain specific word....

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    Adelaide, Australia
    MS-Off Ver
    MS Office 2010
    Posts
    8

    Another Deleting Rows that do not Contain specific word....

    Good morning,
    I am afraid its another newbe to the forum looking for a generous helping hand!! I have a basic spreadsheet where one column contains a string of text (can be any length)
    I am looking to run a Macro that will run through this Column (Column "L") to remove any rows that DO NOT contain the words "open" OR "OPEN" OR "Open".

    I have looked through the forums and have the following code. But nothing happens when I run it:

    Please Login or Register  to view this content.
    Is this code something that can be amended? I am thinking it does work as it worked for someone else who posted, so I am doing something wrong even for just the one keyword search.

    I appreciate any help you can offer me.

    Thanks

    Ben
    Last edited by bennerzuk; 07-07-2014 at 10:11 PM.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Another Deleting Rows that do not Contain specific word....

    Will this work for you? Try on a copy first.

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    07-07-2014
    Location
    Adelaide, Australia
    MS-Off Ver
    MS Office 2010
    Posts
    8

    Re: Another Deleting Rows that do not Contain specific word....

    Hi There Millz,
    Thanks so much for taking the time to reply. I have pasted the Macro accross and get an error - Run-time error '1004': AutoFilter Method of Range Class failed,
    Debug Line is
    Please Login or Register  to view this content.
    I have pasted in exactly what you sent - is this something I am doing incorrect??

    Thanks again mate

    Ben

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Another Deleting Rows that do not Contain specific word....

    How does your data structure looks like?
    Which row is it starting from?
    Is there a header row?
    Or you can just attach a sample workbook for reference.

  5. #5
    Registered User
    Join Date
    07-07-2014
    Location
    Adelaide, Australia
    MS-Off Ver
    MS Office 2010
    Posts
    8

    Re: Another Deleting Rows that do not Contain specific word....

    The structure is straight forward, can not attache as work for a bank and full of personal details. But Range of data is A1:L1605 the column with the text field in which we are looking at is column "L". I can see you had the AutoFilter on 12 so this would seem right to me. There is a header Row on Row 1, so data is starting on Row 2.

    Does this help at all - again I appreciate your time!!

    Ben

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Another Deleting Rows that do not Contain specific word....

    I have no idea why is that error occurring for you, can't duplicate it on my side. I attached a sample workbook to show that the code works, I also made some amendments to handle case where there are no rows to be deleted at all.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-07-2014
    Location
    Adelaide, Australia
    MS-Off Ver
    MS Office 2010
    Posts
    8

    Re: Another Deleting Rows that do not Contain specific word....

    Hi Millz,
    You are a star!! I am an idiot!! I tried the macro as per above and I got the same error. Then I noticed a blank column in "A" which had scrolled one cell to the right so I did not see it!!

    Thanks again for your help!! Fingers crossed I can help others along the formulae front as I am stronger here than macros!!

    Thanks

    Ben

+ 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] Macro for finding specific Word and Deleting it
    By Haidar123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2014, 07:45 AM
  2. Deleting rows if specific cell is blank or have specific text
    By JoaoFerreira1985 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2013, 01:18 PM
  3. [SOLVED] Deleting first word on all rows in column 1 ?
    By Kai in forum Excel General
    Replies: 6
    Last Post: 09-06-2012, 04:09 PM
  4. Deleting of rows containg one specifival word
    By unbelievable in forum Excel General
    Replies: 1
    Last Post: 07-03-2012, 02:09 PM
  5. deleting all rows contaning a word
    By everfresh2 in forum Excel General
    Replies: 2
    Last Post: 05-05-2011, 06:24 PM

Tags for this Thread

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