MS Word - Varying amount of lines

son1k111

New Member
Joined
Nov 5, 2009
Messages
2
Hi,

I have text in word that appears as such,

(heading 1)
Paragraph 1(one line)
Paragraph 2(one line)
(heading 2)
Paragraph 1(one line)
Paragraph 2(one line)
Paragraph 3(one line)
Paragraph 4(one line)
Paragraph 5(one line)
ect...

Each heading does contain the word "heading" at the beginning and has a maximum of 5 paragraphs after each heading.

Each paragraph contains text that is completely different any other paragraphs.

Is there a macro that can count how many paragraphs there are between headings and add new (blank) paragraphs after headings that contain less than 5 paragraphs?

This would then look like such,

(heading 1)
Paragraph 1(one line)
Paragraph 2(one line)
(New Blank Paragraph 3)
(New Blank Paragraph 4)
(New Blank Paragraph 5)
(heading 2)
Paragraph 1(one line)
Paragraph 2(one line)
Paragraph 3(one line)
Paragraph 4(one line)
Paragraph 5(one line)

The purpose of this is so when i copy it into excel, it has exactly 5 lines between each heading for formula purposes. I'm aware that this can be done in a macro in excel but I'm after a macro that will achieve this in word.

Thanks very much,
Chris
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,225,462
Messages
6,185,129
Members
453,279
Latest member
MelissaOsborne

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