+ Reply to Thread
Results 1 to 3 of 3

Delete row that column Type that = II ?

  1. #1
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Delete row that column Type that = II ?

    I want to delete row that column Type not = II and column Status not = Pass , Wait.

    Please guide me about it.

    remark My file have data rows = 300K

    I want solution by VBA
    Attached Images Attached Images

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,409

    Re: Delete row that column Type that = II ?

    Follow output in the image:
    PHP Code: 
    Option Explicit
    Sub pass
    ()
    Dim Lr&, k&, cell As Rangearr()
    Lr Cells(Rows.Count"B").End(xlUp).Row
    ReDim arr
    (1 To Lr1 To 3)
        For 
    Each cell In Range("B2:B" Lr)
            If 
    cell.Value "II" And (cell.Offset(01).Value "Pass" Or cell.Offset(01).Value "Wait"Then
                k 
    1
                arr
    (k1) = cell.Offset(0, -1).Value
                arr
    (k2) = cell.Value
                arr
    (k3) = cell.Offset(01).Value
            End 
    If
        
    Next
    Range
    ("E1:G1").Value Range("A1:C1").Value
    Range
    ("E2").Resize(k3) = arr
    End Sub 
    Attached Images Attached Images
    Quang PT

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Delete row that column Type that = II ?

    Please Login or Register  to view this content.
    Last edited by sintek; 03-22-2022 at 02:26 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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 type (xls) specific file in folder
    By Ericng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2019, 02:09 AM
  2. [SOLVED] Mass delete cell type
    By SM3T in forum Excel General
    Replies: 3
    Last Post: 04-15-2015, 01:59 AM
  3. Delete Same type name from different cells except one.
    By bimalendu.pollutech in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2012, 04:17 AM
  4. How to delete entire row of data, by type of text?
    By allustrious in forum Excel General
    Replies: 2
    Last Post: 11-09-2012, 10:46 AM
  5. Type Mismatch Trying to Delete Rows
    By sweetnumb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2011, 06:40 PM
  6. Sort Column, Delete Rows, Delete Column, Move Molumn, more inside?
    By motown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2008, 09:44 AM
  7. Delete empty rows with cell type 2
    By FrankNL in forum Excel General
    Replies: 1
    Last Post: 05-03-2006, 06:15 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