Get the numbers only of a cell (ignore the text), eg = getnumbers(A1)

Function GetNumbers(Cell As Range) As Long
 Dim LenStr As Long
 For LenStr = 1 To Len(Cell)
  Select Case Asc(Mid(Cell, LenStr, 1))
  Case 48 To 57
   GetNumbers = GetNumbers & Mid(Cell, LenStr, 1)
  End Select
 Next
End Function


© Copyright andrewsexceltips.net All Rights Reserved.