Jump to content

Copy Texts from Word to Excel and paste each word into a cell in a column


Recommended Posts

Posted

Hi,

 

I want to copy the text in Word to excel, and make each word in a cell in a column .

 

For example, the text in Word document is:  " this is a sample  ",  copy to Excel as:

 

this

is

a

sample

 

 

Can I use Word to do that automatically? I'm using word2010

 

 

Posted

Or use the word processor to find/replace all the 'spaces' and replace with a 'tab' or 'comma' and then import into the spreadsheet.

 

Some word processors actually allow you to convert text in situ, into a cell format inside the word processor.

Posted (edited)

 

1) Copy the sentence into excel (it will appear in one cell)

2) In the [Data] wizard (top line of Tabs in the excel window select 'Text to Columns' and select 'space' delimited

3) Copy the row of cells, re-paste as 'paste special' select transposed

 

https://www.extendoffice.com/documents/excel/3475-excel-split-sentence-into-words.html#a1

Edited by richard_smith237
Posted

Hi, 

 

You can do that in excel . In word you can use "Find and Replace" to  replace the space between two words as a  line break. then copy them to excel. Just select all the text, then  enter a space in  “Find what” text box,  enter “^p”  in “Replace with” text box. 

 

Or you can just use VBA to do that for you. I find a code may help. see below:

 

Sub CopySelectParagraphWordByWordToExcel()
 
  If Selection.Range <> "" Then
    Selection.Style = ActiveDocument.Styles("Normal") 
 
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
      .Text = " "
      .Replacement.Text = "^p"
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchByte = True
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
 
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
      .Text = "^p^p"
      .Replacement.Text = "^p"
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchByte = True
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Copy
 
    MsgBox ("Now you can just open a Excel worksheet to paste the text")
  Else
    MsgBox ("There is no selected text ")
  End If
 
End Sub

 

And here is the link of the macro ,

 

https://www.datanumen.com/blogs/2-ways-copy-texts-word-excel-word-separate-cell/

 

Good luck.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...