RegExp example for initial masking:
Code:
Dim re As RegExp
Set re = CreateObject("vbscript.regexp")
re.Pattern = "[a-zA-Z]"
re.Global = True
Debug.Print re.Replace("a'bc-d jh", "_ ")
The added space used for clearer display will complicate replacing with guessed letter. Maybe use some other character such as ? without space.
Replacing mask with selected character. Not seeing a RegExp solution that would be simpler.
Code:
Dim strW As String, strM As String, strL As String, x As Integer
strW = "d'bc-d jh"
strM = "?'??-? ??"
strL = "d"
For x = 1 To Len(strW)
If Mid(strW, x, 1) = strL Then
strM = Left(strM, x - 1) & strL & Mid(strM, x + 1)
End If
Next
Debug.Print strM