Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
import files
How do I open a txt file that has 295000 rows? Presently it opens about
65000 of them. Don't know how to open the rows after 65000. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
import files
Hi Hollis,
Perhaps the following routine, posted by Berie Deitrick, would help: Sub LargeFileImport() ' Bernie Deitrick 'Dimension Variables Dim ResultStr As String Dim FileName As String Dim FileNum As Integer Dim Counter As Double 'Ask User for File's Name FileName = Application.GetOpenFilename 'Check for no entry If FileName = "" Then End 'Get Next Available File Handle Number FileNum = FreeFile() 'Open Text File For Input Open FileName For Input As #FileNum 'Turn Screen Updating Off Application.ScreenUpdating = False 'Create A New WorkBook With One Worksheet In It Workbooks.Add Template:=xlWorksheet 'Set The Counter to 1 Counter = 1 'Loop Until the End Of File Is Reached Do While Seek(FileNum) <= LOF(FileNum) 'Display Importing Row Number On Status Bar Application.StatusBar = "Importing Row " & _ Counter & " of text file " & FileName 'Store One Line Of Text From File To Variable Line Input #FileNum, ResultStr 'Store Variable Data Into Active Cell If Left(ResultStr, 1) = "=" Then ActiveCell.Value = "'" & ResultStr Else ActiveCell.Value = ResultStr End If 'For xl95 change 65536 to 16384 If ActiveCell.Row = 65536 Then 'If On The Last Row Then Add A New Sheet ActiveWorkbook.Sheets.Add Else 'If Not The Last Row Then Go One Cell Down ActiveCell.Offset(1, 0).Select End If 'Increment the Counter By 1 Counter = Counter + 1 'Start Again At Top Of 'Do While' Statement Loop 'Close The Open Text File Close 'Remove Message From Status Bar Application.StatusBar = False End Sub --- Regards, Norman "Hollis" wrote in message ... How do I open a txt file that has 295000 rows? Presently it opens about 65000 of them. Don't know how to open the rows after 65000. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
import files
Hollis
Excel has 65536 rows to a worksheet so data has to be spread over more sheets or columns on same sheet. You could split the data into smaller chunks in your text file and bring over these chunks. OR.........Have a look through these google search results. http://snipurl.com/ayv5 Many methods, one of which may suit. Gord Dibben Excel MVP On Mon, 29 Nov 2004 11:11:01 -0800, Hollis wrote: How do I open a txt file that has 295000 rows? Presently it opens about 65000 of them. Don't know how to open the rows after 65000. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i import xml files into excel | Excel Discussion (Misc queries) | |||
Import Several .txt Files | Excel Discussion (Misc queries) | |||
Import .csv files to Excel | Excel Discussion (Misc queries) | |||
Multiple txt files import | Excel Programming | |||
Import multiple files macro can't find files | Excel Programming |