Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Import data from note pad file thats > 65536 rows (Excel 2000)

    Hi,

    wondering if anyone has a solution for this problem,

    I have a note pade file that has data in it, it exceed 65536 rows of data, I was wondering if there is a way to import every second row??

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Import data from note pad file thats > 65536 rows (Excel 2000)

    Try this:

    Sub ImportEvenLines()
    Dim varFile As Variant
    Dim f As Integer
    Dim strLine As String
    Dim r As Long

    On Error GoTo ErrHandler

    varFile = Application.GetOpenFilename("Text files,*.txt")
    If VarType(varFile) = vbBoolean Then
    Beep
    Exit Sub
    End If

    f = FreeFile
    Open varFile For Input As #f
    Do While Not EOF(f)
    Line Input #f, strLine
    Line Input #f, strLine
    r = r + 1
    Range("A" & r) = strLine
    Loop

    ExitHandler:
    Close #f
    Exit Sub

    ErrHandler:
    If Not Err = 62 Then ' ignore end of file
    MsgBox Err.Description, vbExclamation
    End If
    Resume ExitHandler
    End Sub

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Import data from note pad file thats > 65536 rows (Excel 2000)

    > I cant use the text to columns function

    Why not?

  4. #4
    2 Star Lounger
    Join Date
    May 2005
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Import data from note pad file thats > 65536 rows (Excel 2000)

    My apologies I have got the text to columns funtion working thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •