• Add Word 2002 documents word to excel (Excel 2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Add Word 2002 documents word to excel (Excel 2002)

    Author
    Topic
    #385978

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #667841

      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.

      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
      
      • #667908

        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!

    Viewing 0 reply threads
    Reply To: Add Word 2002 documents word to excel (Excel 2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: