VB Code:
  1. Dim maxl As Integer, mystr As String, s, mystart As Integer, pos As Integer, mychar As String
  2. Dim i As Integer
  3. maxl = 3
  4. mystart = 1
  5. pos = 1
  6. mystr = "qqqqqqqqqweeeerrrrrrrtttttttttyyuuuuuuuuuiiiiiooooooooppppppppp"
  7.  
  8. For i = 1 To Len(mystr)
  9.     mychar = String(maxl + 1, Mid(mystr, i, 1))
  10.     pos = InStr(i, mystr, mychar)
  11.     If Not pos = 0 Then
  12.     If pos = i Then
  13.         mystr = Left(mystr, i + maxl - 1) & Right(mystr, Len(mystr) - i - maxl) & Mid(mystr, i, 1)
  14.         i = i - 1
  15.         End If
  16.     End If
  17. Next
  18. Debug.Print mystr

try this

pete