Este es mi código, espero que os guste.
Saludos
Código (vb) [Seleccionar]
Private Function uCaseCorrector(txt As String) As String
Dim Signos As String
Dim Espacios() As Integer
Dim a, b As Integer
Dim tmp As String
Dim tmp2 As String
'Los signos a controlar, se puede incrementar
Signos = ".;:¿?¡!"
'Sacamos los espacios
ReDim Espacios(1 To Len(txt))
For a = 1 To Len(txt)
b = b + 1
If Mid(txt, a, 1) = " " Then
Espacios(b) = b
b = b - 1
Else
tmp = tmp + Mid(txt, a, 1)
End If
Next a
b = 0
'Corregimos el texto
For b = 1 To Len(Signos)
For a = 1 To Len(tmp)
If Mid(tmp, a, 1) = Mid(Signos, b, 1) And a + 1 < Len(tmp) Then
Mid(tmp, a + 1, 1) = UCase(Mid(tmp, a + 1, 1))
End If
Next a
Next b
'Colocamos los espacios
For a = 1 To Len(txt)
If Espacios(a) <> 0 Then
tmp2 = tmp2 + " " + Mid(tmp, a, 1)
Else
tmp2 = tmp2 + Mid(tmp, a, 1)
End If
Next a
'La Solucion
uCaseCorrector = tmp2
End Function
Saludos