Dim str As String = "8888488"
Dim flag As Boolean = TrueDim ps As String = ""For Each s As String In str If ps <> "" AndAlso ps <> s Then msgbox(s) flag = False Exit For End If ps = sNext
msgbox(flag)