How to find english words from a list of rubbish (VBA help)

Associate
Joined
26 Feb 2004
Posts
971
Location
China (Qinhuangdao)
Not sure whether I should have posted this in 'Windows & other software", but I thought the solution would be some kind of code, so...

I have a list in Excel of series of 6 letter words. Almost all are not English words, i.e. they do not appear in an English dictionary, so if spellchecking, the dialogue box would appear.

There are 231,868 words in my list. I want to remove all the entries which are not actually words.

Here is an example :

crises
crisia
crisib
crisie
crisii
crisil
crisio
crisis
crisla
crislb
crisle

In this small selection, crises and crisis are words, the rest are not. So I would just delete all the entries which are not.

I though this could be done in VBA, with something simple like using cells.checkspelling to return if the word doesn't appear in the dictionary. However, this just brings up the spelling dialogue box.

Do you think there would be a way of doing this?
 
That's excellent! Worked perfectly! I slightly modified your code to :

Code:
Sub SimonCHere()

Dim WrdCount As Integer

    For t = 2 To 231869
    
        Cells(t, 2).Select
        If Not Application.CheckSpelling(word:=Cells(t, 2)) Then
            Cells(t, 2).Clear
        Else
            Debug.Print Cells(t, 2) '   to monitor, out of interest
            WrdCount = WrdCount + 1
            Cells(WrdCount, 4) = Cells(t, 2)
        End If
    Next t

End Sub

Just for your information, of my selection of 231,868, only 88 are English words!
 
Last edited:
Back
Top Bottom