+ Reply to Thread
Results 1 to 7 of 7

delete row based on criteria

Hybrid View

  1. #1
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,925

    Re: delete row based on criteria

    The code below worked for the small sample data provided.
    Option Explicit
    Sub TEST()
        Dim CharPos     As Long, _
            RowCount    As Long, _
            TestRow     As Long
        
        RowCount = Cells(Rows.Count, "A").End(xlUp).Row
        
        For TestRow = RowCount To 1 Step -1
            
            CharPos = 0
            Do
                CharPos = CharPos + 1
            Loop While (CharPos < Len(Range("A" & TestRow).Value) And (Asc(Mid(Range("A" & TestRow).Value, CharPos, 1)) - 91 > 0))
            If CharPos = Len(Range("A" & TestRow).Value) Then
                'Debug.Print Range("A" & TestRow).Value
                Range("A" & TestRow).EntireRow.Delete
            End If
        Next TestRow
    End Sub
    Ben Van Johnson

  2. #2
    Forum Contributor
    Join Date
    07-26-2009
    Location
    Slovakia
    MS-Off Ver
    Excel 2019
    Posts
    244

    Re: delete row based on criteria

    thanks buddy ! it works perfectly, only when cell contains two or more words it doesnt work it is possible to solve it somehow?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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