Datatellsall2
New Member
- Joined
- Jul 17, 2018
- Messages
- 23
Hello -
I'm trying to convert a table of contents in word to go into the following table in excel via VBA. I would like the table of contents details (excluding the page #) to be one column, and the next column would include the page number for reference. If possible, I would like a unique ID to be assigned based on the page number. For instance if I have a data on page 1 and it's the first reference, I would like it to read 1-1; the first number would be the page number and the second number would be the unique ID. Here is an example :
Word table of contents:
Title from Page - page 1
Quality Checks - page 1
Sounding board - page 2
Checklist - page 3
Page by Page Details - page 4
Reference Data - page 4
Excel Document: (example output)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Contents[/TD]
[TD]Page #[/TD]
[TD]Unique ID[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Title from Page[/TD]
[TD]1[/TD]
[TD]1-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Quality Checks[/TD]
[TD]1[/TD]
[TD]1-2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sounding board[/TD]
[TD]2[/TD]
[TD]2-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Checklist[/TD]
[TD]3[/TD]
[TD]3-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Page by Page Details[/TD]
[TD]4[/TD]
[TD]4-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Reference Data[/TD]
[TD]4[/TD]
[TD]4-2[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Really need a VBA code for this if possible.
Thanks in advance,
Matt
I'm trying to convert a table of contents in word to go into the following table in excel via VBA. I would like the table of contents details (excluding the page #) to be one column, and the next column would include the page number for reference. If possible, I would like a unique ID to be assigned based on the page number. For instance if I have a data on page 1 and it's the first reference, I would like it to read 1-1; the first number would be the page number and the second number would be the unique ID. Here is an example :
Word table of contents:
Title from Page - page 1
Quality Checks - page 1
Sounding board - page 2
Checklist - page 3
Page by Page Details - page 4
Reference Data - page 4
Excel Document: (example output)
[TABLE="width: 500"]
<tbody>[TR]
[TD]Contents[/TD]
[TD]Page #[/TD]
[TD]Unique ID[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Title from Page[/TD]
[TD]1[/TD]
[TD]1-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Quality Checks[/TD]
[TD]1[/TD]
[TD]1-2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sounding board[/TD]
[TD]2[/TD]
[TD]2-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Checklist[/TD]
[TD]3[/TD]
[TD]3-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Page by Page Details[/TD]
[TD]4[/TD]
[TD]4-1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Reference Data[/TD]
[TD]4[/TD]
[TD]4-2[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Really need a VBA code for this if possible.
Thanks in advance,
Matt