S
Striker
Given the following code posted by Kaak, how would I copy data from
different places in this 500 Byte record to different cells in the
spreadsheet. The file I am working with may have up to 1000 records in it
each day, and each record is 500 bytes. I was thinking that sLineOfText
already contains the data that I need, so why copy from one variable to
another as below.
I was thinking about doing something like
Cell A2.value = Trim(Mid(sLineOfText, 38, 15))
Cell A2.value = Trim(Mid(sLineOfText, 10, 10))
'After copying date to this row in Excel I need to move down one row to be
ready for the next record.
Thank You
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~FROM AN EARLIER POST~~~~~~~~~~~~~~~~~~~
Dim sLineOfText, sFirstName as String
Open "C:\Temp\TextFle.txt" For Input As #1
Do Until EOF(1)
Line Input #1, sLineOfText
sFirstName = Mid(sLineOfText, 38, 15)
msgbox sFirstName
Loop
Close #1
different places in this 500 Byte record to different cells in the
spreadsheet. The file I am working with may have up to 1000 records in it
each day, and each record is 500 bytes. I was thinking that sLineOfText
already contains the data that I need, so why copy from one variable to
another as below.
I was thinking about doing something like
Cell A2.value = Trim(Mid(sLineOfText, 38, 15))
Cell A2.value = Trim(Mid(sLineOfText, 10, 10))
'After copying date to this row in Excel I need to move down one row to be
ready for the next record.
Thank You
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~FROM AN EARLIER POST~~~~~~~~~~~~~~~~~~~
Dim sLineOfText, sFirstName as String
Open "C:\Temp\TextFle.txt" For Input As #1
Do Until EOF(1)
Line Input #1, sLineOfText
sFirstName = Mid(sLineOfText, 38, 15)
msgbox sFirstName
Loop
Close #1