Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
have a text file that is more lines than can fit in a single worksheet in
excel how do I import the data from that text sheet on to multiple sheets without importing the same lines more than once. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could open the txt file in notepad, cut half of it, paste and save it as
1.txt the other half as 2.txt then open each in a separate excel sheet Not that this is the best way if you need to do this more often, but it should work. "jason2444" wrote: have a text file that is more lines than can fit in a single worksheet in excel how do I import the data from that text sheet on to multiple sheets without importing the same lines more than once. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Another alternative is to run this code: it opens the original file and
creates sequentially numbered sub-files, which you can import to Excel. Note you'll need to adjust the file path and possibly the TXT file extension. The sub-files are called "Target" in this code, which you can change- but you'll need to change all instances within the code. You can adjust the number of rows per file from 60,000 to whatever is appropriate. Enjoy! Sub Import_Trim() Dim Lyne As String Dim FileCount As Byte, K As Byte FileCount = 1 Open "c:\directory path\Source File Name.txt" For Input As #1 Open "c:\directory path\Target1.txt" For Output As #2 On Error Resume Next Do While Not EOF(1) For K = 1 To 60000 Line Input #1, Lyne Print #2, Lyne Next K Close #2 FileCount = FileCount + 1 Open "c:\directory path\Target" & FileCount & ".txt" For Output As #2 Loop Close #1 Close #2 MsgBox "Done." End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stop excel from dropping the 0 in the beginning of a number? | Setting up and Configuration of Excel | |||
How to import a text file to Excel treating all input content are in string. | Excel Discussion (Misc queries) | |||
Formulas dealing with text data | Excel Worksheet Functions | |||
how do I enable "import text file" excel 2002? | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) |