LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Parsing Data String from text file line

On 21 Apr 2007 11:01:10 -0700, gtslabs wrote:

I am having trouble parsing the data line extracting the correct lines
using string commands.
Is there an easier way to get this info?


The Split function should do what you want:

==================================
Sub ParseLine()
Const sTest As String = "Data1|Data2|Data3|Data4|Data5|Data6|Data7|Dat a8"
Dim arrData As Variant
Dim i As Long

arrData = Split(sTest, "|")

For i = 5 To 7
Debug.Print i, arrData(i - 1)
Next i

End Sub
================================
--ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing / seperating text string in excel cell sfleck Excel Discussion (Misc queries) 7 November 16th 07 12:24 AM
Parsing a text string into separate cells Bobalew Excel Worksheet Functions 1 June 6th 07 09:16 PM
Import & Parsing a small 400 line CSV file tarns[_8_] Excel Programming 3 March 13th 06 02:38 AM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM
Reads entire *.txt file into string opposed to a desired line by line input. ej_user Excel Programming 3 October 11th 04 07:15 PM


All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"