MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > General Excel Discussion & Other Questions

General Excel Discussion & Other Questions *Do not post questions about Excel or Access in this forum* This forum is for Excel-related discussion and questions concerning programs other than Excel or Access. This is also the place to ask about book suggestions or other websites.

Reply
 
Thread Tools Display Modes
Old Nov 6th, 2009, 04:51 AM   #1
son1k111
 
Join Date: Nov 2009
Posts: 2
Default MS Word - Varying amount of lines

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
son1k111 is offline   Reply With Quote
Old Nov 6th, 2009, 05:06 AM   #2
Smitty
MrExcel MVP
Moderator
 
Smitty's Avatar
 
Join Date: May 2003
Location: Boulder Creek, CA
Posts: 18,775
Default Re: Varying amount of lines

Welcome to the Board!

You might want to try the Word Forum over at www.TheOfficeExperts.com
__________________
Smitty

Every once in a while, there's a sudden gust of gravity...

Microsoft Excel MVP

Smitty is offline   Reply With Quote
Old Nov 6th, 2009, 05:13 AM   #3
son1k111
 
Join Date: Nov 2009
Posts: 2
Default Re: MS Word - Varying amount of lines

Thanks Smitty,

i just realized after i posted it that this was only macros for excel.
son1k111 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.