kcgmani2004
New Member
- Joined
- Feb 18, 2015
- Messages
- 1
<tbody>
[TD="class: votecell"][/TD]
[TD="class: postcell"]I have text file which has data mentioned below format
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> "$B$6|9020541.78113024"
"$C$6|91873471.2672928"
"$D$6|596376192.52119"
"$E$6|697270205.569613" </code>Delimiters is "|" The first half before the delimiter is the Cell Address (Say B6) and the second half is the value which has to be copied over the workbook to a specific sheet(Say worksheet1)
I have already accomplished of loading the text file and read the content by looping but couldnt progress.
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> Open SplitTxtFile For Input As # 1
Do Until EOF ( 1 )
Line Input # 1 , FileLine
Dim SplitFileLine As Variant
Dim newFileLine As String
newFileLine = Replace ( FileLine , Chr ( 34 ), "" )
SplitFileLine = Split ( newFileLine , "|" ) ' This split doesnt work </code><code style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: pre-wrap; background-color: rgb(238, 238, 238);">'The data to be split and copy the value in appropriate cell address in the worksheet(ws1</code>)
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"> Loop
Close # 1
Please help to progress further. Ignore the text file read portion which is already accomplished by reading the directory.
</code>
[/TD]
</tbody>
Last edited: