Frankbelly was telling us: Frankbelly nous racontait que :
[Quoted Text] > I'm trying to determine if the current selection contains any > characters that are not a digit or a colon > > Any help is greatly appreciated
Try something like this:
Sub CheckForDigitColon()
Dim strToCheck As String Dim i As Long
strToCheck = Selection.Text i = 1
Do If Not Mid(strToCheck, i, 1) Like "#" And _ Not Mid(strToCheck, i, 1) Like ":" Then MsgBox "There is a character that is not a digit or " _ & "a colon at position # " & i & "." Exit Sub End If i = i + 1 Loop While i <= Len(strToCheck)
MsgBox "There are only digits and/or colons in the selection."
End Sub
-- Salut! _______________________________________ Jean-Guy Marcil - Word MVP jmarcilREMOVE[ at ]CAPSsympatico.caTHISTOO Word MVP site: http://www.word.mvps.org
|