Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using MsOffice 97.
The following is my code to import text file into the worksheet. The text file contains 7000 rows. i = 2 Open "c:\cost_centre.txt" For Input As #1 Do While Not EOF(1) Line Input #1, inline If Not IsEmpty(inline) Then strCC = Mid(inline, 6, 8) strSS = Mid(inline, 28, 1) strCG = Mid(inline, 32, 4) Sheets(currSheet).Range("a" & i) = strCC Sheets(currSheet).Range("b" & i) = strSS Sheets(currSheet).Range("c" & i) = strCG i = i + 1 End If Loop Close #1 I have performance problem with above code. It took 5 mins to copy into the worksheet. What is the fastest way to open a text file? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I import text file of cash flow to excel file then use formula | Excel Discussion (Misc queries) | |||
Would Like to Automate Batch File Creation and Text FIle Import | Excel Discussion (Misc queries) | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Import text file into excel with preset file layout, delimeters VBA | Excel Programming | |||
Get External Data, Import Text File, File name problem | Excel Programming |