PC Review


Reply
Thread Tools Rate Thread

"Start import at row"-limit when importing text to worksheet

 
 
=?Utf-8?B?TWlra2VsIFJhbmRvcmYgSGVnbmjDuGo=?=
Guest
Posts: n/a
 
      4th May 2005
Hi there!

I'm using Excel 2003 to do analyse large textfiles, to do this I regularly
imports text to Excel, but unfortunately I've realized that there are some
limitations when importing text files.

I have a text file which has more that 65536 lines (which is the maximum row
numbers in one Excel worksheet), when I import this in Excel I first fill one
worksheet.
Now - the great thing is that I should be able to import the rest of the
textfile on another worksheet, so I start the "Text Impor Wizard", but when
using the feature "Start import at row" - the maximum row number I can type
is 32767... :-(

Of course I can start deleting lines from my textfile - but...

Please - Would you plan on changing this, so that this scenario would be
possible to solve?

Best Regards!
--
Mikkel Randorff Hegnhøj
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th May 2005
You may want to send your suggestion to MS. These newsgroups are usually just
people helping people. MS doesn't monitor every post (as far as I know...).

email your request to:
(E-Mail Removed)



Mikkel Randorf Hegnhøj wrote:
>
> Hi there!
>
> I'm using Excel 2003 to do analyse large textfiles, to do this I regularly
> imports text to Excel, but unfortunately I've realized that there are some
> limitations when importing text files.
>
> I have a text file which has more that 65536 lines (which is the maximum row
> numbers in one Excel worksheet), when I import this in Excel I first fill one
> worksheet.
> Now - the great thing is that I should be able to import the rest of the
> textfile on another worksheet, so I start the "Text Impor Wizard", but when
> using the feature "Start import at row" - the maximum row number I can type
> is 32767... :-(
>
> Of course I can start deleting lines from my textfile - but...
>
> Please - Would you plan on changing this, so that this scenario would be
> possible to solve?
>
> Best Regards!
> --
> Mikkel Randorff Hegnhøj


--

Dave Peterson
 
Reply With Quote
 
Guest
Posts: n/a
 
      6th May 2005
I'm not good at English, so I don't know whether this is what you expected or not.
But I think this could be done by using vba, if I've not misunderstood your
writing.
in my case(Excel 2002), i could import textfile with about 120000 lines by using
macros under though it took some time to import all data.

Sub importtext()
Dim fs, f, fss
Dim startrow As Long, endrow As Long, inrow As Long, count As Long
Dim retstring As String

'the row number where data is first entered(this could be changed if you
like )
startrow = 1

Selection.End(xlDown).Select
'the row number where data is last entered(this could be changed if you like)
endrow = Selection.Row
Selection.End(xlUp).Select

'the line number in a textfile where data start to be imported
'(this could be changed if you like)
startline = 1

Set fs = CreateObject("Scripting.FileSystemObject")

MsgBox "Select textfile to import"

Set fss = Application.FileDialog(msoFileDialogFilePicker)

If fss.Show = True Then

Else
Exit Sub
End If

On Error Resume Next

Set f = fs.OpenTextFile(fss.SelectedItems.Item(1), 1, False, -2)

If IsEmpty(f) Then
MsgBox "Can't open " & fss.SelectedItems.Item(1)
Exit Sub
End If

On Error GoTo 0

inrow = startrow
count = 1

Do While f.AtEndOfStream <> True
retstring = f.ReadLine

If count >= startline Then
'the cell where data is entered
Cells(inrow, "a").Value = retstring
Application.StatusBar = "processing line number = " & count
inrow = inrow + 1
End If

count = count + 1

If inrow > endrow Then
Worksheets.Add after:=ActiveSheet
inrow = startrow
End If
Loop

End Sub


"Mikkel Randorf Hegnhøj" <(E-Mail Removed)> wrote in message
news:EBC24E35-FE98-4966-A108-(E-Mail Removed)...
> Hi there!
>
> I'm using Excel 2003 to do analyse large textfiles, to do this I regularly
> imports text to Excel, but unfortunately I've realized that there are some
> limitations when importing text files.
>
> I have a text file which has more that 65536 lines (which is the maximum row
> numbers in one Excel worksheet), when I import this in Excel I first fill one
> worksheet.
> Now - the great thing is that I should be able to import the rest of the
> textfile on another worksheet, so I start the "Text Impor Wizard", but when
> using the feature "Start import at row" - the maximum row number I can type
> is 32767... :-(
>
> Of course I can start deleting lines from my textfile - but...
>
> Please - Would you plan on changing this, so that this scenario would be
> possible to solve?
>
> Best Regards!
> --
> Mikkel Randorff Hegnhøj


--
keizi kounoike

 
Reply With Quote
 
=?Utf-8?B?TWlra2VsIFJhbmRvcmYgSGVnbmjDuGo=?=
Guest
Posts: n/a
 
      9th May 2005
Great thanks!

Although I hopefully can manage to get this to work, lot's of people don't
know VBA, so I guess they would prefer the slight change in the GUI.

:-)

But thanks for the solution anyway!

-Mikkel

"(E-Mail Removed)" wrote:

> I'm not good at English, so I don't know whether this is what you expected or not.
> But I think this could be done by using vba, if I've not misunderstood your
> writing.
> in my case(Excel 2002), i could import textfile with about 120000 lines by using
> macros under though it took some time to import all data.
>
> Sub importtext()
> Dim fs, f, fss
> Dim startrow As Long, endrow As Long, inrow As Long, count As Long
> Dim retstring As String
>
> 'the row number where data is first entered(this could be changed if you
> like )
> startrow = 1
>
> Selection.End(xlDown).Select
> 'the row number where data is last entered(this could be changed if you like)
> endrow = Selection.Row
> Selection.End(xlUp).Select
>
> 'the line number in a textfile where data start to be imported
> '(this could be changed if you like)
> startline = 1
>
> Set fs = CreateObject("Scripting.FileSystemObject")
>
> MsgBox "Select textfile to import"
>
> Set fss = Application.FileDialog(msoFileDialogFilePicker)
>
> If fss.Show = True Then
>
> Else
> Exit Sub
> End If
>
> On Error Resume Next
>
> Set f = fs.OpenTextFile(fss.SelectedItems.Item(1), 1, False, -2)
>
> If IsEmpty(f) Then
> MsgBox "Can't open " & fss.SelectedItems.Item(1)
> Exit Sub
> End If
>
> On Error GoTo 0
>
> inrow = startrow
> count = 1
>
> Do While f.AtEndOfStream <> True
> retstring = f.ReadLine
>
> If count >= startline Then
> 'the cell where data is entered
> Cells(inrow, "a").Value = retstring
> Application.StatusBar = "processing line number = " & count
> inrow = inrow + 1
> End If
>
> count = count + 1
>
> If inrow > endrow Then
> Worksheets.Add after:=ActiveSheet
> inrow = startrow
> End If
> Loop
>
> End Sub
>
>
> "Mikkel Randorf Hegnhøj" <(E-Mail Removed)> wrote in message
> news:EBC24E35-FE98-4966-A108-(E-Mail Removed)...
> > Hi there!
> >
> > I'm using Excel 2003 to do analyse large textfiles, to do this I regularly
> > imports text to Excel, but unfortunately I've realized that there are some
> > limitations when importing text files.
> >
> > I have a text file which has more that 65536 lines (which is the maximum row
> > numbers in one Excel worksheet), when I import this in Excel I first fill one
> > worksheet.
> > Now - the great thing is that I should be able to import the rest of the
> > textfile on another worksheet, so I start the "Text Impor Wizard", but when
> > using the feature "Start import at row" - the maximum row number I can type
> > is 32767... :-(
> >
> > Of course I can start deleting lines from my textfile - but...
> >
> > Please - Would you plan on changing this, so that this scenario would be
> > possible to solve?
> >
> > Best Regards!
> > --
> > Mikkel Randorff Hegnhøj

>
> --
> keizi kounoike
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing text files into a "cached" worksheet? Zilla Microsoft Excel Programming 4 16th Jan 2008 01:14 AM
how to set "end" of worksheet/limit scrollbar range Skeezix Microsoft Excel Misc 0 12th Sep 2003 04:49 AM
Re: how to set "end" of worksheet/limit scrollbar range John Wilson Microsoft Excel Misc 2 10th Sep 2003 05:06 AM
how to set "end" of worksheet/limit scrollbar range Peter Atherton Microsoft Excel Misc 0 10th Sep 2003 02:23 AM
Re: how to set "end" of worksheet/limit scrollbar range John Wilson Microsoft Excel Misc 0 10th Sep 2003 02:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:40 AM.