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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,215,504
Messages
6,125,185
Members
449,213
Latest member
Kirbito

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