Guest User

Untitled

a guest
Dec 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Public Function Leftish(s As String)
  2. 'returns first n chars which fit pattern *nn?
  3. Dim x As Long
  4. Dim flag As Boolean
  5. Dim a As String
  6. For x = 1 To Len(s)
  7. a = a & Mid(s, x, 1)
  8. If IsNumeric(Right(a, 1)) Then flag = True
  9. If (flag And Not IsNumeric(Right(a, 1))) Then Exit For
  10. Next x
  11. Leftish = a
  12.  
  13. End Function
Add Comment
Please, Sign In to add comment