| | |
Counting Numbers inside text area
Thread Solved
![]() |
•
•
Join Date: Aug 2008
Posts: 77
Reputation:
Solved Threads: 0
I am having a problem on how to count numbers inside text area. . .
example: In my text area I have 10 numbers.
12, 06, 31, 22, 53, 28, 96, 71, 10, 47
the the program should count how many 0,1,2,3,4....9 excluding the comma. I don't know how to do this inside a text area or a multiline text box. Can anyone help me or give an example or idea on how to do this. . . .please.
example: In my text area I have 10 numbers.
12, 06, 31, 22, 53, 28, 96, 71, 10, 47
the the program should count how many 0,1,2,3,4....9 excluding the comma. I don't know how to do this inside a text area or a multiline text box. Can anyone help me or give an example or idea on how to do this. . . .please.
try this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Sub xx() Dim txt As String Dim x As Variant Dim i As Long txt = "10,11,12,13,14,15,16,17,18,1,2,3,4" x = Split(txt, ",") For i = 0 To UBound(x): Next i MsgBox "There are " & i & " numbers in your text area" End Sub
•
•
Join Date: Mar 2009
Posts: 773
Reputation:
Solved Threads: 137
•
•
•
•
try this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Sub xx() Dim txt As String Dim x As Variant Dim i As Long txt = "10,11,12,13,14,15,16,17,18,1,2,3,4" x = Split(txt, ",") For i = 0 To UBound(x): Next i MsgBox "There are " & i & " numbers in your text area" End Sub
Why not just use ubound+1?
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Sub xx() Dim txt As String Dim x As Variant Dim i As Long txt = "10,11,12,13,14,15,16,17,18,1,2,3,4" x = Split(txt, ",") MsgBox "There are " & UBound(x) + 1 & " numbers in your text area" End Sub
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- PHP Text-Area Help (PHP)
- Formatting text area (PHP)
- Large Icon ListView like with Text area (Visual Basic 4 / 5 / 6)
- limit text area words (PHP)
- Remove Selected Value from the Text Area (JavaScript / DHTML / AJAX)
- Problem in getting values of a text area by row and column wise (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Anyone know how to add column on the vb datagrid
- Next Thread: Reading a binary file in chunks...
| Thread Tools | Search this Thread |
* 6 2007 access activex add age basic beginner birth bmp calculator cd cells.find click client code college connection connectionproblemusingvb6usingoledb creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit excel excelmacro file filename form header iamthwee image inboxinvb internetfiledownload listbox listview liveperson login looping microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading remotesqlserverdatabase report save search sendbyte sites sql sql2008 sqlserver subroutine tags time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web windows






