G
Guest
I am creating a report from a supplied comma seperated quote delimited text file. The problem I am having is populating a row with this information and getting each seperated value in the respective column. The code below shows what I assumed would work.
Is there a way to take a delimited string and have the information populate the repective cell without looping through each element and progromatically populate each cell?
Dim intLineNum As Integer = 11
Dim strRange As String
Dim strDelimiterChar As String = ","
Dim strDelimiter As Char() = strDelimiterChar.ToCharArray()
Dim strSplit As String() = Nothing
Do
strLine = sr.ReadLine()
If Not (strLine = Nothing) Then
strSplit = strLine.Split(strDelimiter)
strRange = "A" + intLineNum.ToString() + ":" + "H" + intLineNum.ToString()
xlWKSheet.Range(strRange.ToString()).Value = strSplit.ToString()
intLineNum = intLineNum + 1
End If
Loop Until strLine Is Nothing
sr.Close()
Is there a way to take a delimited string and have the information populate the repective cell without looping through each element and progromatically populate each cell?
Dim intLineNum As Integer = 11
Dim strRange As String
Dim strDelimiterChar As String = ","
Dim strDelimiter As Char() = strDelimiterChar.ToCharArray()
Dim strSplit As String() = Nothing
Do
strLine = sr.ReadLine()
If Not (strLine = Nothing) Then
strSplit = strLine.Split(strDelimiter)
strRange = "A" + intLineNum.ToString() + ":" + "H" + intLineNum.ToString()
xlWKSheet.Range(strRange.ToString()).Value = strSplit.ToString()
intLineNum = intLineNum + 1
End If
Loop Until strLine Is Nothing
sr.Close()