#1
|
|||
|
|||
Need to provide numbering to the text
Please Find Attached the input and output
This is my Input: ABC12345 REFERENCE Marks Subject Sub_code 10 Eng AS23412 GUL-32 20 Math AS26412 30 Science FW56432 40 Com AS26432 50 Soc AS20624 ABC45879 REFERENCE Marks Subject DAP23412 10 Eng AS23412 GUL-32 20 Bio AS26412 30 Zool FW56432 40 Com AS26432 40 MAth AS26432 50 Soc AS20624 ABC45885 REFERENCE Marks Subject DAP23412 10 Eng AS23412 GUL-32 20 Com AS26412 30 Zoo FW56432 40 Math AS26432 50 Soc AS20624 Below is the output Which I need. 1. ABC12345 REFERENCE Marks Subject Sub_code 10 Eng AS23412 GUL-32 20 Math AS26412 30 Science FW56432 40 Com AS26432 50 Soc AS20624 2. ABC45879 REFERENCE Marks Subject DAP23412 10 Eng AS23412 GUL-32 20 Bio AS26412 30 Zool FW56432 40 Com AS26432 40 MAth AS26432 50 Soc AS20624 3. ABC45885 REFERENCE Marks Subject DAP23412 10 Eng AS23412 GUL-32 20 Com AS26412 30 Zoo FW56432 40 Math AS26432 50 Soc AS20624 |
#2
|
||||
|
||||
You don't really need a macro for this. Apply the List Number style to the headings. If your document is typical the following will do it.
Code:
Sub AddNumStyle() Dim oPara As Range Dim oTable As Table For Each oTable In ActiveDocument.Tables Set oPara = oTable.Range oPara.Collapse 1 oPara.Start = oPara.Start - 2 oPara.Collapse 1 oPara.End = oPara.Paragraphs(1).Range.End oPara.Style = "List Number" Next oTable End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Thanks... The Macro worked..
I need an aditional change for the same ,need to add an blank line after each table. |
#4
|
||||
|
||||
While the spacing would be better introduced with paragraph spacing rather than 'inserting a blank line', add the following before Next oTable
Code:
Set oPara = oTable.Range oPara.End = oPara.End + 1 oPara.Collapse 0 oPara.InsertParagraphAfter
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
Thanks Graham..
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to provide different formatting in a caption? | bantu | Word | 2 | 06-28-2014 11:25 PM |
How to Create a Reference Style That Will Provide an author (date) citation | djwalsh | Word | 3 | 03-17-2014 05:28 AM |
List Numbering position on right text | vanzilz | Word | 3 | 02-26-2014 12:45 AM |
Numbering issue gap bettween 1.1 and text lower and higer numbering leave no gap | Turtlesrun | Word | 3 | 02-21-2014 04:48 AM |
Using Numbering for Manually Numbered Text | gokceng | Word | 10 | 09-25-2013 05:02 PM |