bueno este codigo surgio para ayudar a un amigo a hacer un filtro en un textbox.. el lo queria para filtrar caracteres para cambiar la clave de windows XP...
es muy simple, basico:
Código
Dim sInclude As String Private Sub Form_Load() sInclude = "bcdfghjkmpqrtvwxy2346789" End Sub Private Sub Text1_Change() Dim iTemp As Integer Dim sLetra As String Dim sTotal As String Dim iPos As Integer Dim bSetNew As Boolean For iPos = 1 To Len(Text1.Text) sLetra = Mid(Text1.Text, iPos, 1) If InStr(1, LCase(sInclude), LCase(sLetra)) > 0 Then sTotal = sTotal & sLetra Else bSetNew = True End If Next iPos If bSetNew Then iTemp = Text1.SelStart Text1.Text = sTotal Text1.SelStart = IIf(iTemp > 0, iTemp - 1, iTemp) End If End Sub
espero q sirva de algo, saludos!