Hi there, the below code is being used to retrieve transport details from a text file onto an excel spreadsheet. The problem i have is that theres more than 1 transport detail in some files,i need to display these on the same line in the column beside it....Can anyone help?
Thanks
Example of what code does:
00-11-23-45-11-dd
00-11-23-45-31-dd
00-11-23-45-81-dd
For i = 0 To 4
If InStr(1, GetLine, "Transport:" > 0 Then 'Search for Network Card
If InStr(1, GetLine, "00-00-00-00-00-00" > 0 Then
Debug.Print "No Card: " & GetLine
Line Input #FF, GetLine
ActiveCell.Offset(e, 4).Value = Right(GetLine, Len(GetLine) - InStr(1, GetLine, "," + 1)
ActiveCell.Offset(e, 4).Value = Mid(ActiveCell.Offset(e, 4).Value, 3, 17)
If ActiveCell.Offset(e, 4).Value = "" Then ActiveCell.Offset(e, 4).Value = "No Card"
e = e + 1
Else
Debug.Print "Card: " & GetLine
ActiveCell.Offset(e, 4).Value = Right(GetLine, Len(GetLine) - InStr(1, GetLine, "," + 1)
Debug.Print "Right: " & ActiveCell.Offset(e, y).Value
ActiveCell.Offset(e, 4).Value = Mid(ActiveCell.Offset(e, 4).Value, 3, 17)
Debug.Print "Mid: " & ActiveCell.Offset(e, 4).Value
e = e + 1
End If
End If
Exit For
Next i
Thanks
Example of what code does:
00-11-23-45-11-dd
00-11-23-45-31-dd
00-11-23-45-81-dd
For i = 0 To 4
If InStr(1, GetLine, "Transport:" > 0 Then 'Search for Network Card
If InStr(1, GetLine, "00-00-00-00-00-00" > 0 Then
Debug.Print "No Card: " & GetLine
Line Input #FF, GetLine
ActiveCell.Offset(e, 4).Value = Right(GetLine, Len(GetLine) - InStr(1, GetLine, "," + 1)
ActiveCell.Offset(e, 4).Value = Mid(ActiveCell.Offset(e, 4).Value, 3, 17)
If ActiveCell.Offset(e, 4).Value = "" Then ActiveCell.Offset(e, 4).Value = "No Card"
e = e + 1
Else
Debug.Print "Card: " & GetLine
ActiveCell.Offset(e, 4).Value = Right(GetLine, Len(GetLine) - InStr(1, GetLine, "," + 1)
Debug.Print "Right: " & ActiveCell.Offset(e, y).Value
ActiveCell.Offset(e, 4).Value = Mid(ActiveCell.Offset(e, 4).Value, 3, 17)
Debug.Print "Mid: " & ActiveCell.Offset(e, 4).Value
e = e + 1
End If
End If
Exit For
Next i