1

Topic: numbered paragraphs from Word to Excel

there are paragraphs in word
1.doc:
1. text
1.1. text
...
20.text
20.1. text
20.1.1. text
....
numbers of points to convert and excel
no text
1.xls:
1.
1.1.
...
20.
20.1.
20.1.1.
thank you.

2

Re: numbered paragraphs from Word to Excel

> and excel
In excel

3

Re: numbered paragraphs from Word to Excel

Amiri;
can you attach an example in Word AND Excel? Where should the code run from - Word, Excel, vbs?

4

Re: numbered paragraphs from Word to Excel

wrote:

Amiri;
can you attach an example in Word AND Excel? Where should the code run from - Word, Excel, vbs?

sorry here is an example

5

Re: numbered paragraphs from Word to Excel

in excel
A B
------
1 |
------
1.1 |
------
1.1.1 |

6

Re: numbered paragraphs from Word to Excel

7

Re: numbered paragraphs from Word to Excel

crazy method. just to a head more comes nothing.
replace in excel different characters on the dot.

8

Re: numbered paragraphs from Word to Excel

fu* up best practice (

9

Re: numbered paragraphs from Word to Excel

Amiri;
try this in Word. Excel must be running, the code will create a new workbook and place text there.

Sub bb ()
Dim p As Paragraph, i&, s $
With GetObject ("excel.application").workbooks. Add (-4167).worksheets (1)
.Columns (1).NumberFormat =
For Each p In ActiveDocument. Paragraphs
i = i + 1
.Cells (i, 1) = p. Range. ListFormat. ListString
s = p. Range. Text
.Cells (i, 2) = Left $ (s, Len (s) - 1)
Next
.Application. Visible = True
End With
End Sub

10

Re: numbered paragraphs from Word to Excel

wrote:

Amiri;
try this in Word. Excel must be running, the code will create a new workbook and place text there.

Sub bb ()
Dim p As Paragraph, i&, s $
With GetObject ("excel.application").workbooks. Add (-4167).worksheets (1)
.Columns (1).NumberFormat =
For Each p In ActiveDocument. Paragraphs
i = i + 1
.Cells (i, 1) = p. Range. ListFormat. ListString
s = p. Range. Text
.Cells (i, 2) = Left $ (s, Len (s) - 1)
Next
.Application. Visible = True
End With
End Sub

it really works) thank. and you can remove all the text leaving only the numbers. there is a very large document points to 1.1.1 and to 500.43.1
best practices
in dog f1n (dot) in (contact f u in case)