Reading huge .txt file

Bragato

New Member
Joined
Nov 26, 2017
Messages
7
I'm creating a VBA code to read a .txt with aproximately 10k lines and 105k words, currently I got this:

Sub GetTxt()
Dim objFSO As Object
Dim objTF As Object
Dim strIn 'As String
Dim X


PilarTxt = Range("C1")


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTF = objFSO.OpenTextFile(Sheets("Controle").Range("C3") & "" & PilarTxt & "\PARTEPL.LST", 1)
strIn = objTF.readall
X = Split(strIn, vbNewLine)
[b3].Resize(UBound(X) + 1, 1) = Application.Transpose(X)
objTF.Close


End Sub

It reads the .txt and inputs it to the B3 and downward cells.
It's very good, because it's the faster one I found online, but it doesn't copy all of the .txt data.

Can anyone help me solve this? A fast script to read all of the .txt?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,216,550
Messages
6,131,304
Members
449,642
Latest member
jobon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top