+ Reply to Thread
Results 1 to 7 of 7

VBA - Delete rows with certain data

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    19

    VBA - Delete rows with certain data

    Hi All,

    My VBA knowledge is quite limited so please forgive any stupid questions.

    I have some code that deletes any rows where the current year is in column B. This is as below.

    Please Login or Register  to view this content.
    This works fine where there is cell with the current year in column B, but it doesn't work where the current year isn't present.

    Please could someone advise how I can skip this and go to the next step of my coding in the event the current year is not in any cell within column B?

    Kind Regards,

    Chris

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: VBA - Delete rows with certain data

    Administrative Note:

    Welcome to the forum.

    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.

    As yiu are new I will add the link https://www.mrexcel.com/forum/excel-...tain-data.html

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Mumbai, IN
    MS-Off Ver
    Office 365
    Posts
    97

    Re: VBA - Delete rows with certain data

    EDIT: Moderator has already checked duplicate forum posts, please avoid that to comply.

    A little more info about what you are trying to achieve.

    But this should get you working

    Please Login or Register  to view this content.
    Last edited by yoursamrit2000; 09-04-2019 at 08:22 AM. Reason: Didnt Check Moderator Notes Before Posting

  4. #4
    Registered User
    Join Date
    09-04-2019
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    19

    Re: VBA - Delete rows with certain data

    Quote Originally Posted by Pepe Le Mokko View Post
    Administrative Note:

    Welcome to the forum.

    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.
    I'm really sorry, this is totally my fault. I wasnt aware of the affiliation between the two forums. Sorry again.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: VBA - Delete rows with certain data

    If you have read https://www.excelguru.ca/content.php?184 as suggested, you would have understood that there is no connection between our board and MrE.
    I suggest you take a moment to read our forum rules. (not so many and rather clear)
    Thx

  6. #6
    Registered User
    Join Date
    09-04-2019
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    19

    Re: VBA - Delete rows with certain data

    Yep, like I have already said, it was totally my fault. Wont happen again.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: VBA - Delete rows with certain data

    Thanks a lot

+ 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. VBA to delete rows starting from row 18 and delete data in one column from row 17
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2017, 04:54 PM
  2. [SOLVED] Move data on duplicate rows (different columns) to one row and delete extra rows?
    By Sagwa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 08:25 AM
  3. Replies: 4
    Last Post: 11-13-2013, 11:15 AM
  4. Replies: 1
    Last Post: 08-24-2013, 07:01 AM
  5. [SOLVED] Delete blank rows between data rows, shift rows up, then repeat
    By excelactuary in forum Excel General
    Replies: 2
    Last Post: 03-11-2013, 11:53 AM
  6. [SOLVED] VBA insert/delete rows to accommodate exact number of rows from incoming data
    By iloc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2012, 06:19 PM
  7. Delete duplicate rows with same data in certain columns for million rows
    By amlan009 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-08-2012, 12:53 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