Re: extracting numbers separated by commas >>help<<
Look up the split() function in your online help. This will allow you to parse the numbers out based on the seperator character into an array. There should be an example in the help file as well.
Re: extracting numbers separated by commas >>help<<
Blast from the past! (except I had to search the forums, as I misplaced the sample's name...)
Code:
Option Explicit
Private Sub Form_Load()
Dim x As Integer, st As String
Dim ff As Integer
Dim strBuff As String
Dim str() As String
ff = FreeFile
Open App.Path & "\to do.txt" For Input As #ff
strBuff = Input(LOF(ff), ff)
Close #ff
' ----------------- two ways to skin a cat --------------
MsgBox "Lines = " & Len(strBuff) - Len(Replace(strBuff, vbCrLf, "x")) + 1
' -------------------------------------------------------
str() = Split(strBuff, vbCrLf)
MsgBox "There are " & UBound(str) + 1 & " lines in the file"
For x = 0 To UBound(str)
st = st & str(x) & vbCrLf & vbCrLf
Next x
MsgBox st
End Sub
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.