Hi Everyone,
i've just spent 2 hours searching and trying lots of solutions to this from what i found and nothing is quite right for what I want. I'm trying to play with words and find word patterns, i'm trying to find anagrams of words with an extra letter
eg
mod - mood
mod - doom
mod - mode
dos - mods
ood - doom
so my nice simple code was
and then check how many letters match
so mod-mode would count 3
dos to mods would also count 3
but mod to mood would count 6 - m-1 o-2 o-2 d-1
i tried removing double letters from the shorter word and changing the calculation based on that
od(ood) to mood would be 3 great
od(ood) to doda would also come out as 3 - d-2 o-1
and not all words are 3 & 4 letters, the longest words are 10 letters long
ABANDONER & ABANDONERS which 9 letters are the same but double A & double N would count 13
as part of other bits i've been doing i do have a list of all the words sorted in alphabetical character order so MOD would be DMO and MOOD would be DMOO, not sure if that would be helpful for this in anyway but thought i'd throw it in incase someone came up with the idea
i've just spent 2 hours searching and trying lots of solutions to this from what i found and nothing is quite right for what I want. I'm trying to play with words and find word patterns, i'm trying to find anagrams of words with an extra letter
eg
mod - mood
mod - doom
mod - mode
dos - mods
ood - doom
so my nice simple code was
VBA Code:
For y = 1 To Len(firstword)
For x = 1 To Len(secondword)
firstletter = Mid(firstword, y, 1)
secondletter = Mid(secondword, x, 1)
If firstletter = secondletter Then
secondwordcount = secondwordcount + 1
Exit For ' this fixed some double letter issues but not all
Else
secondwordcount = secondwordcount
End If
Next x
Next y
If secondwordcount = 3 Then
and then check how many letters match
so mod-mode would count 3
dos to mods would also count 3
but mod to mood would count 6 - m-1 o-2 o-2 d-1
i tried removing double letters from the shorter word and changing the calculation based on that
od(ood) to mood would be 3 great
od(ood) to doda would also come out as 3 - d-2 o-1
and not all words are 3 & 4 letters, the longest words are 10 letters long
ABANDONER & ABANDONERS which 9 letters are the same but double A & double N would count 13
as part of other bits i've been doing i do have a list of all the words sorted in alphabetical character order so MOD would be DMO and MOOD would be DMOO, not sure if that would be helpful for this in anyway but thought i'd throw it in incase someone came up with the idea