Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2015, 04:26 AM
preeti preeti is offline Need to provide numbering to the text Windows 7 32bit Need to provide numbering to the text Office 2010 32bit
Novice
Need to provide numbering to the text
 
Join Date: Jan 2015
Posts: 3
preeti is on a distinguished road
Default 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
Attached Files
File Type: docx Input_output.docx (18.7 KB, 10 views)
Reply With Quote
  #2  
Old 01-19-2015, 04:50 AM
gmayor's Avatar
gmayor gmayor is offline Need to provide numbering to the text Windows 7 64bit Need to provide numbering to the text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #3  
Old 01-20-2015, 09:56 AM
preeti preeti is offline Need to provide numbering to the text Windows 7 32bit Need to provide numbering to the text Office 2010 32bit
Novice
Need to provide numbering to the text
 
Join Date: Jan 2015
Posts: 3
preeti is on a distinguished road
Default

Thanks... The Macro worked..

I need an aditional change for the same ,need to add an blank line after each table.
Reply With Quote
  #4  
Old 01-20-2015, 10:37 PM
gmayor's Avatar
gmayor gmayor is offline Need to provide numbering to the text Windows 7 64bit Need to provide numbering to the text Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #5  
Old 01-22-2015, 01:08 AM
preeti preeti is offline Need to provide numbering to the text Windows 7 32bit Need to provide numbering to the text Office 2010 32bit
Novice
Need to provide numbering to the text
 
Join Date: Jan 2015
Posts: 3
preeti is on a distinguished road
Default

Thanks Graham..
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to provide numbering to the text 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft