PDA

View Full Version : [SOLVED:] Copy Paragraph Headings and Text in MS word to Excel using Excel VBA



Asiri
12-12-2019, 04:45 AM
Copy Paragraph Headings to Excel heading and paragraph text to the Cell below the column heading using Excel VBA

Dear All,

I have been trying for a few days now with no luck, could not find a proper code to automate the below task. I highly Appreciate it if anyone can guide me on this.

I have lots of word documents which I need to copy paragraph heading and the underline text into Excel. Headings to Column Headings, And other text to a single cell below the Column heading. it should be saved on the same worksheet. The paragraph heading in word are not always the same, but the Heading style is set to "Heading style 1"

The code would ideally perform the following way

1.Code Select the Paragraph Heading in word doc with Ms word "Heading Style 1" and check if the heading is already saved in excel worksheet as a column heading, If it is not there, add the paragraph heading to column heading in excel worksheet.

2.Copy the entire text under each paragraph Heading in the word doc to a single cell under the matching Column Heading.

Thank you for your consideration

p45cal
12-12-2019, 05:55 AM
Is this you:
https://www.excelguru.ca/forums/showthread.php?10171-Importing-Data-From-MS-Word-to-MS-Excel
?

Asiri
12-12-2019, 06:35 AM
NO But i will definitely check it

macropod
12-12-2019, 03:41 PM
For code to process content associated with given heading Styles, see: http://www.vbaexpress.com/forum/showthread.php?65295-Copying-the-tables-and-corresponding-section-header-from-a-word-using-excel-vba