- Home
·
- Math/Dates
·
- The code finds the numerical values in an array that consists of many characters including numbers
The code finds the numerical values in an array that consists of many characters including numbers
The code finds the numerical values in an array that consists of many characters including numbers
Rate The code finds the numerical values in an array that consists of many characters including numbers
(1(1 Vote))
Dim length As Long
Dim NumberArray() As Variant
length = Len(Text1.Text)
ReDim NumberArray(CountNumber((Text1.Text)))
j = 0
For i = 1 To length
If IsNumeric(Mid(Text1.Text, i, 1)) Then
NumberArray(j) = Mid(Text1.Text, i, 1)
j = j + 1
End If
Next i
For i = 0 To UBound(NumberArray)
List1.AddItem NumberArray(i)
Next i
End Sub
Private Function CountNumber(metin As Variant) As Long
Dim i, result As Long
Dim length As Long
length = Len(metin)
result = 0
For i = 1 To length
If IsNumeric(Mid(Text1.Text, i, 1)) Then
result = result + 1
End If
Next i
CountNumber = result
End Function
The code finds the numerical values in an array that consists of many characters including numbers Comments
No comments yet — be the first to post one!
Post a Comment