Forum Discussion

Rahiros's avatar
Rahiros
Copper Contributor
Oct 23, 2025

Delete cells with 3 consecutive consonants

I submitted a question a little while back asking how to delete cells with exactly 3 consonants. The response I had was a huge help, but now I'm faced with a similar problem: How do I sort words by consecutive consonants? And if that cannot be achieved, how can I instead delete cells from a sheet in which a word has 3 consecutive consonants?

1 Reply

  • How about this:

     

    Simply delete cells that contain 3 or more consecutive consonants:

     

    Google Sheets Formula (Filter):

    =FILTER(A1:A, NOT(REGEXMATCH(A1:A, "[^aeiouAEIOU]{3}")))

    Excel VBA Script (Delete Matching Cells):

    Sub DeleteConsonantCells()
        Dim cell As Range
        Dim regex As Object
        Set regex = CreateObject("VBScript.RegExp")
        regex.Pattern = "[^aeiouAEIOU]{3}"
        regex.IgnoreCase = True
        regex.Global = True
    
        For Each cell In Selection
            If regex.Test(cell.Value) Then
                cell.ClearContents
            End If
        Next cell
    End Sub

    Select the range first, then run this macro to clear cells with 3+ consecutive consonants.

Resources