Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works great... thanks for the help...
Ernst. "Randy Harmelink" wrote: Something like this should work: Dim strTemp As String Dim strFileName As String strFileName = "C:\MenuItem.Dat" Open strFileName For Input As #1 ' Open file for output. Do While Not EOF(1) ' Loop until end of file. Line Input #1, strTemp ' Read line into variable. Debug.Print strTemp ' Print to the Immediate window. Loop Close #1 Just replace the "Debug.Print" line with whatever you want to do with the line of data that was read from the file. On Mar 21, 5:58 am, Ernst Guckel wrote: This is what I have to write the data... Sub MenuItem() Dim c As Range Dim strTemp As String Dim strFileName As String strFileName = "C:\MenuItem.Dat" Open strFileName For Output As #1 ' Open file for output. For Each c In Range("ItemRange") strTemp = c.Cells(1, 6).Value If c.Cells(1, 6).Value = "" Then GoTo NextItem Print #1, strTemp NextItem: Next Close #1 ' Close file. End Sub and an the data file looks like this: 000Whop Jr. Whop Jr 000010000000001100000010101 001Whop Jr./Chz Whop Jr/C000011900000001100000010101 003Whopper Whopper 000029900000001100000010101 004Whopper/Chz Whopper/C000033900000001100000010101 I cannot load the data as binary because it was not writen that way. Nor can I write it at binary because the POS system that uses the file needs it in a text format... I actually don't want to dump the array to a range. I would prefer to step through it and write it each line at a time... I can handle this... I cannot figure out how to load the array... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reading from a file | Excel Programming | |||
reading txt file and copying the lines in new excel file | Excel Programming | |||
reading from another file and pasting to current file, "combobox" | New Users to Excel | |||
reading data from 2nd file in 1st file using Combobox | Excel Programming | |||
reading from text file to excel file | Excel Programming |