Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Posts
    309
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add Word 2002 documents word to excel (Excel 2002)

    I have a Word 2002 document with 500 words (Multiple paragraphs).

    Example first 2 sentences.. Today is a nice day for a party. I will see you at the party.

    I want the 500 words to go into Excel (One word per cell starting in cell A1).

    Example: Today in cell A1, is in cell A2, a in cell A3 etc. Is this possible?

    Thanks in advance.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add Word 2002 documents word to excel (Excel 2002)

    How are you planning to get the text from the document into Excel? Copy and Paste? Macro? Some other way?

    If you copy the text and paste it into cell A1, then the following macro will split the words into A1 through An.

    <pre>Public Sub TextToRows()
    Dim strWk As String, lLen As Long, I As Long
    strWk = Range("A1").Value
    strWk = Application.WorksheetFunction.Substitute(strWk, Chr(10), " ")
    strWk = Application.WorksheetFunction.Substitute(strWk, Chr(13), " ")
    I = 0
    Do While Len(strWk) > 0
    lLen = InStr(strWk, " ")
    If lLen > 0 Then
    Range("A1").Offset(I, 0).Value = Left(strWk, lLen - 1)
    strWk = Trim(Right(strWk, Len(strWk) - lLen))
    Else
    Range("A1").Offset(I, 0).Value = Trim(strWk)
    strWk = ""
    End If
    I = I + 1
    Loop
    End Sub
    </pre>

    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Birmingham, England
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add Word 2002 documents word to excel (Excel 2002)

    Text to columns should also work, the delimiter between words being a space.
    But will there be a problem about the max number of columns in a worksheet, which might be 255?
    Various inelegant workarounds come to mind (split source file into <> 255 word lumps, eg) but no douibt there's a hugely elegant way, too.
    Why are you doing this? - I'm curious!

Posting Permissions

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