Best way to get 200 paragraphs from Word into Excel

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
I have a Word document with a couple hundred short paragraphs. Each paragraph is a verse with 4 lines. Lines 2-4 are separated from the previous line with a linefeed (not a carriage return). That's the arrow pointing down and to the left, not the paragraph mark. Like this:

VBA Code:
Line 1(lf)
Line 2(lf)
Line 3(lf)
Line 4(cr)

I would like to import them into a spreadsheet with each verse in a cell so I can add columns with categorization information. I tried copying 3-4 verses to the clipboard and pasting then into a cell, but each line went into a different cell.

Is there an easy way to get each verse in a cell so I have 200 rows with a verse in the cell in column C?

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Don't know if this will help without seeing some sample data. Here I've assumed there are 4 verses each of which occupies 4 consecutive cells in col A, with no empty cells between verses. These are restructured in col C with a verse in each of four consecutive cells.
Book1.xlsm
ABC
1Line1Line1 Line2 Line3 Line4
2Line2Line5 Line6 Line7 Line8
3Line3Line9 Line10 Line11 Line12
4Line4Line13 Line14 Line15 Line16
5Line5
6Line6
7Line7
8Line8
9Line9
10Line10
11Line11
12Line12
13Line13
14Line14
15Line15
16Line16
Sheet3

VBA Code:
Sub OneVersePerCell()
'assumes each verse is in 4 sequential rows, no blanks between verses
Dim R As Range, ct As Long
Set R = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
Application.ScreenUpdating = False
For i = 1 To R.Rows.Count Step 4
    ct = ct + 1
    Range("C" & ct).Value = Join(Application.Transpose(Range("A" & i, "A" & i + 3)), Chr(10))
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
So you are suggesting that I go ahead and paste the text into Excel with each line going into a separate cell, then run your macro to join then together again?
 
Upvote 0
So you are suggesting that I go ahead and paste the text into Excel with each line going into a separate cell, then run your macro to join then together again?
Yes. If that's suitable, then maybe someone can help with automating the import of the 200 verses to Excel.
 
Upvote 0
Hey, it works!(y):)

I did have to add a Dim statement for i.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top