+ Reply to Thread
Results 1 to 5 of 5

delete row based on cell value vba

  1. #1
    Registered User
    Join Date
    02-03-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    37

    delete row based on cell value vba

    Examples11-25.xlsx


    How you doing everyone. I need your help once again.

    I want to delete rows based on a value that this in column P. Currently I have "ZZZ" to identify the deleted rows.
    But I can change the value to anything(number or text). I just wanted to have a unique value so I can delete the entire rows based on that value and leave the rest.

    My range of rows will never be defined due to it not being consistent.

    Can someone help me with VBA code to make this possible. Let me know if I need to add more info.

    Thanks for your help.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: delete row based on cell value vba

    You may try this code. The code will prompt you to input the criteria from column P so as per your sample sheet, when prompted, you will input "zzz" or "ZZZ" to delete all the rows where there is "ZZZ" in col. P.
    Please Login or Register  to view this content.
    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: delete row based on cell value vba

    Hi 1vision,
    try this
    Please Login or Register  to view this content.
    Last edited by nilem; 11-26-2014 at 01:17 AM. Reason: add If .Count = 1 Then Exit Sub

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,295

    Re: delete row based on cell value vba

    Hi,

    Here is some other VBA code that does what I think you want. It is a little easier than the above.
    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    02-03-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: delete row based on cell value vba

    Thank you all. I will try all 3 codes. I will also learn from all three codes. Thank you. I will get back to you guys once I try them.

+ 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. Delete Row # based on cell value
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-13-2013, 02:23 PM
  2. Delete row based on cell FORMAT (color, font, etc) (not based on cell value)
    By trobey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2012, 10:39 AM
  3. Delete row based on cell value
    By oOarthurOo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2010, 03:35 PM
  4. Delete row based on Cell value
    By MSchibs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2010, 01:24 AM
  5. Delete Row Based on Cell of Another
    By pkbravo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2007, 12:34 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