# Importing more than 65,000 rows into excel?

**URL:** <https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536>\
**Category:** NYSpeed Off Topic\
**Created:** [February 24, 2009, 7:23am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536 "2009-02-24T07:23:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 7:23am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/1 "2009-02-24T07:23:51Z")

</div>

Is there an easy way?

I would rather not cut/paste into individual csv files as it takes forever just to highlight the data? ( only 500,000 rows)

I do not know VB, but i’ll bet it would be easy to write a macro to import them?

Any thoughts?

---

<div class="post-metadata">

**Author:** ![zwarbyt](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/zwarbyt/32/7623_2.png) [@zwarbyt](https://forums.speedlife.net/u/zwarbyt)\
**Post date:** [February 24, 2009, 7:26am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/2 "2009-02-24T07:26:47Z")

</div>

upgrade to 2007

---

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 7:34am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/3 "2009-02-24T07:34:58Z")

</div>

> [@zwarbyt](#):
>
> upgrade to 2007

I thought you knew about the corporate life.

---

<div class="post-metadata">

**Author:** ![Joe](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/joe/32/7219_2.png) [@Joe](https://forums.speedlife.net/u/Joe)\
**Post date:** [February 24, 2009, 7:36am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/4 "2009-02-24T07:36:31Z")

</div>

short answer: No.  
You can however, bring in a 500k row CSV to Access.

---

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 7:55am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/5 "2009-02-24T07:55:26Z")

</div>

☹  
Access not found.

---

<div class="post-metadata">

**Author:** ![zwarbyt](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/zwarbyt/32/7623_2.png) [@zwarbyt](https://forums.speedlife.net/u/zwarbyt)\
**Post date:** [February 24, 2009, 8:12am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/6 "2009-02-24T08:12:00Z")

</div>

get them to buy you 07

no other real options

---

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 8:20am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/7 "2009-02-24T08:20:58Z")

</div>

I’m, in the 300k’s and 10 sheets now…  
I’ll post the macro if it works and does not crash when done.

---

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 8:37am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/8 "2009-02-24T08:37:23Z")

</div>

516621 rows successfully imported into one excel file with 11 sheets.🤓

I had to make a few changes to some code I found online, and I had to create a schema.ini file.

> Sub ImportLargeFileADO()  
> 'Imports text file into Excel workbook using ADO.  
> 'If the number of records exceeds 65536 then it splits it over more than one sheet.  
> '[danielklann.com](http://www.danielklann.com/Excel/importing_large_text_files_into.htm)
> 
> ```
> Dim strFilePath As String, strFilename As String, strFullPath As String
> Dim lngCounter As Long
> Dim oConn As Object, oRS As Object, oFSObj As Object
> 
> 'Get a text file name
> strFullPath = Application.GetOpenFilename("Text Files (*.csv),*.csv", , "Please select csv file...")
> 
> If strFullPath = "False" Then Exit Sub 'User pressed Cancel on the open file dialog
> 
> 'This gives us a full path name e.g. C:	emp\folder\file.txt
> 'We need to split this into path and file name
> Set oFSObj = CreateObject("SCRIPTING.FILESYSTEMOBJECT")
> 
> strFilePath = oFSObj.GetFile(strFullPath).ParentFolder.Path
> strFilename = oFSObj.GetFile(strFullPath).Name
> 
> 'Open an ADO connection to the folder specified
> Set oConn = CreateObject("ADODB.CONNECTION")
> oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=" & strFilePath & ";" & _
> "Extended Properties=""text;HDR=Yes;FMT=Delimited(,)"""
> 
> Set oRS = CreateObject("ADODB.RECORDSET")
> 
> 'Now actually open the text file and import into Excel
> oRS.Open "SELECT * FROM " & strFilename, oConn, 3, 1, 1
> While Not oRS.EOF
> Sheets.Add
> ActiveSheet.Range("A1").CopyFromRecordset oRS, 65536
> Wend
> 
> oRS.Close
> oConn.Close
> 
> ```
> 
> End Sub

schema.ini

> [data.csv]  
> ColNameHeader=True  
> Format=CSVDelimited  
> MaxScanRows=25  
> CharacterSet=ANSI

---

<div class="post-metadata">

**Author:** ![Joe](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/joe/32/7219_2.png) [@Joe](https://forums.speedlife.net/u/Joe)\
**Post date:** [February 24, 2009, 8:38am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/9 "2009-02-24T08:38:45Z")

</div>

you’re not saving as a CSV are you? CSV’s require seperate files for each sheet.

---

<div class="post-metadata">

**Author:** ![drvnkd](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/drvnkd/32/109615_2.png) [@drvnkd](https://forums.speedlife.net/u/drvnkd)\
**Post date:** [February 24, 2009, 8:52am UTC](https://forums.speedlife.net/t/importing-more-than-65-000-rows-into-excel/63536/10 "2009-02-24T08:52:51Z")

</div>

nope.  
I had a data logger that generates my .csv files.

But, it makes huge files. I need to analyze the data in excel.  
The problem I had was getting from .csv to xls.
