+ Reply to Thread
Results 1 to 4 of 4

Unable to delete rows using VBA

  1. #1
    Registered User
    Join Date
    10-26-2016
    Location
    U.K
    MS-Off Ver
    2010
    Posts
    7

    Unable to delete rows using VBA

    Hi.

    I was looking for some assistance please, I have spent the best part of today trying to find a way to do this but really struggling

    Whilst browsing online I found a few examples but when I tried using these none of them have worked for me

    I have a workbook with several worksheets, on each worksheet I need to delete all rows that meet the following criteria

    1, All cells in columns B that are blank, and
    2, All cells in column B that contain text "Blue" or "Black"

    As far as deleting all rows that are blank I have this working using the following coding

    Please Login or Register  to view this content.
    But i am not sure why the following does not work? it does remove all the blank rows but doesnt delete the rows where column b contains blue or black

    Please Login or Register  to view this content.
    Any help is appreciated, thanks

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Unable to delete rows using VBA

    Use xlor instead of or

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Unable to delete rows using VBA

    Maybe array the criteria

    I'm sure you would still require the error traps

    Please Login or Register  to view this content.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,884

    Re: Unable to delete rows using VBA

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Unable to Delete Table Rows
    By omagoodness in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-27-2019, 04:53 PM
  2. [SOLVED] Unable to delete Row
    By King Mustard in forum Excel General
    Replies: 2
    Last Post: 11-22-2019, 12:03 PM
  3. Unable to delete certain rows
    By Wiking in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2016, 09:37 AM
  4. Unable to insert or delete rows
    By AvrilA in forum Excel General
    Replies: 3
    Last Post: 04-12-2016, 02:53 AM
  5. Unable to delete rows
    By Kingsta in forum Excel General
    Replies: 1
    Last Post: 06-01-2014, 05:49 AM
  6. [SOLVED] Unable to delete rows
    By Mrowe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2012, 03:08 PM
  7. Unable to delete rows or columns? Why?
    By Barney Quinn in forum Excel General
    Replies: 3
    Last Post: 09-17-2006, 09:43 PM

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