VB Code:
  1. Const TESTDATA = "999999999"
  2.     Dim lngIndex As Long
  3.     Dim bDifferent As Boolean
  4.    
  5.     For lngIndex = 1 To 9
  6.         If Mid$(TESTDATA, lngIndex, 1) <> Left$(TESTDATA, 1) Then
  7.             bDifferent = True
  8.             Exit For
  9.         End If
  10.     Next
  11.    
  12.     If bDifferent Then
  13.         MsgBox "They are not the same"
  14.     Else
  15.         MsgBox "They are the same"
  16.     End If