Hereafter is a macro (VB6) that converts 2 adjacent lowercase consonants into the 1st remaining in lowercase and the 2nd converted into uppercase. Well, so far so good, but the problem is that it works only when both consonants are the same, i.e. cc, ll, pp, ss, etc. become cC, lL, pP, sS, etc. respectively. That's OK and that's what I want, but I also want two different adjacent consonants (any combination) to be converted the same way, i.e. ct, cz, mp, sz, etc. to become cT, cZ, mP, sZ, etc.
Any solution, please?
Dim SearchArray As Variant: Dim myRange As Range: Dim i As Long:
Dim pFind As String: Dim pReplace As String
SearchArray = Array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", _
"r", "s", "t", "v", "w", "x", "y", "Z", "ç", "ñ", _
ChrW(&H161), ChrW(&H9E), ChrW(&H107), ChrW(&H10D), ChrW(&H11F), ChrW(&H142), ChrW(&H144), ChrW(&H148), ChrW(&H155), _
ChrW(&H159), ChrW(&H15B), ChrW(&H15F), ChrW(&H163), ChrW(&H17A), ChrW(&H17C), ChrW(&H158), ChrW(&H123), ChrW(&H137), _
ChrW(&H13C), ChrW(&H146), ChrW(&H10F), ChrW(&H165))
ReplaceArray = Array("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", _
"R", "S", "T", "V", "W", "X", "Y", "Z", "Ç", "Ñ", _
ChrW(&H160), ChrW(&H8E), ChrW(&H106), ChrW(&H10C), ChrW(&H11E), ChrW(&H141), ChrW(&H143), ChrW(&H147), ChrW(&H154), _
ChrW(&H158), ChrW(&H15A), ChrW(&H15E), ChrW(&H162), ChrW(&H179), ChrW(&H17B), ChrW(&H142), ChrW(&H122), ChrW(&H136), _
ChrW(&H13B), ChrW(&H145), ChrW(&H10E), ChrW(&H164))
Set myRange = ActiveDocument.Range: For i = LBound(SearchArray) To UBound(SearchArray)
pFind = SearchArray(i) + SearchArray(i): pReplace = SearchArray(i) + ReplaceArray(i)
With myRange.Find: .Text = pFind: .Replacement.Text = pReplace: .Execute Replace:=wdReplaceAll
End With: Next