none
Word document having list of decimal, alphabet, roman, and sub points. how to identify and separate with the help of a macro RRS feed

  • Question

  • 1. Agenda 2. Meeting 3. Reports 3.a Annual 3.b Common size balance sheet 4. Results 5. Election  - (Decimal) I want to separate and sort by numbering as is.

    a. Agenda b. Meeting c. Reports d.a Annual d.b Common size balance sheet e. Results f. Election  - (Lower Alphabets)

    A. AGENDA B. MEETING C. REPORTS D.A ANNUAL D.B COMMON SIZE BALANCE SHEET E. RESULTS F. ELECTION  - Upper Alphabets

    I. Agenda II. Meeting III. Reports IV.a Annual IV.b Common size balance sheet V. Results VI. Election – Upper Roman 

    i. agenda ii. meeting iii. reports iv.a annual iv.b common size balance sheet v. results vi. election – Lower Roman 

    1. Agenda 2. Meeting 3. Reports 3.1 Annual 3.2 Common size balance sheet 4. Results 5. Election  - (Decimal with sub-points) I want to separate and sort by numbering as is.

    Please help and provide a macro for this one.

    The digit separator is a point (.) and the decimal separator is a comma (,

    Monday, January 13, 2014 7:36 PM

All replies

  • Your question isn't clear. Could you please provide more information. Perhaps very clear examples about what you're starting with AND how the result should look. What you provide is unclear as to what is the starting point (all of it?) and what is the desired result.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 14, 2014 2:13 PM
    Moderator
  • Sub Macro2()

    '

    ' Macro2 Macro

    '

    '

      Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = " ^#."

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

        Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = " ^#^#."

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

       Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = " ^#^#^#."

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = " ^##.)"

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = " Resolution ^#^#.)"

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = "Prop.^#."

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    Selection.Find.Execute Replace:=wdReplaceAll

        Selection.Find.ClearFormatting

        Selection.Find.Replacement.ClearFormatting

        Selection.Find.Replacement.Highlight = True

        With Selection.Find

            .Text = "Resolution."

            .Replacement.Text = "^p^&"

            .Forward = True

            .Wrap = wdFindAsk

            .Format = True

            .MatchCase = False

            .MatchWholeWord = True

            .MatchWildcards = False

            .MatchSoundsLike = False

            .MatchAllWordForms = False

        End With

    End Sub

     

    Wednesday, January 15, 2014 10:03 AM
  • Sub Macro2()
    '
    ' Macro2 Macro
    '
    '
      Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = " ^#."
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = " ^#^#."
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
       Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = " ^#^#^#."
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = " ^##.)"
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = " Resolution   #^#.)"
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = "Prop.#."
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    Selection.Find.Execute Replace:=wdReplaceAll
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        Selection.Find.Replacement.Highlight = True
        With Selection.Find
            .Text = "Resolution. "
            .Replacement.Text = "^p^&"
            .Forward = True
            .Wrap = wdFindAsk
            .Format = True
            .MatchCase = False
            .MatchWholeWord = True
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
    End Sub

    Wednesday, January 15, 2014 10:08 AM
  • It's still not clear what you're starting with and what the result would be. A recorded macro is of little use since it's not commented what the effect of each step should be. And if the recorded macro works, why do you need our help?

    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 15, 2014 4:32 PM
    Moderator
  • Hello,

    I am in bit confusion while making a recorded macro.

    Initially I prepared for numerical numbering (1 to 10)

    For example if this is the text containing 7 points. I want to have be in splitted form:

    AGENDA OF THE MEETING

    1.OPENING OF THE EXTRAORDINARY GENERAL MEETING OF SHAREHOLDERS. 2.ELECTION OF THE CHAIRPERSON OF THE EXTRAORDINARY GENERAL MEETING OF SHAREHOLDERS. 3.PREPARATION OF THE ATTENDANCE LIST, ACKNOWLEDGEMENT THAT THE EXTRAORDINARY GENERAL MEETING OF SHAREHOLDERS HAS BEEN CONVENED APPROPRIATELY AND IS CAPABLE OF ADOPTING BINDING RESOLUTIONS. 4.ADOPTION OF THE AGENDA OF THE EXTRAORDINARY GENERAL MEETING. 5.ADOPTION OF THE RESOLUTION REGARDING THE SALE OF AN ORGANISED PART OF ENTERPRISE. 6.ADOPTION OF THE RESOLUTION AMENDING THE COMPOSITION OF THE SUPERVISORY BOARD OF THE BANK. 7.CLOSING OF THE EXTRAORDINARY GENERAL MEETING OF SHAREHOLDERS

    Can you provide a separate macro for this as it is recorded macro it is not executing if number is above 10.  Please help.

    Coming to second question if the numbering is in Romans (I, II, III, IV ) and in alphabet (A, B, C, D) form I have no idea how to split those:   

    EXAMPLE TEXT:

    Numbering as alphabets

    A. Presentation of the  financial statements and annual  report for the 2010 financial year  with the report of the Supervisory  Board, the group financial  statements, the group annual  report, and the report pursuant to  Sections 289(4) and 315(4) of the  German Commercial Code B.  Ratification of the acts of the Board of MDs C. Ratification of the acts of the Supervisory  Board D. Appointment of  auditors for the 2011 financial  year: PricewaterhouseCoopers AG,  Frankfurt E. Elections to the  Supervisory. Board (1) Peter Maria Wagner (2) Michael Hirschi (3)  Andrea Sieber

    Numbering as alphabets and have sub-points with a number

    A.1 Presentation of the financial statements and annual  report for the 2010 financial year  with the report A.2 Supervisory  Board, the group financial  statements, the group annual  report A.3 the report pursuant to  Sections 289(4) and 315(4) of the  German Commercial Code B.  Ratification of the acts of the  Board of MDs C.1 Ratification  of the acts of the Supervisory  Board C.2. Appointment of auditors for the 2011 financial  year: PricewaterhouseCoopers AG,  Frankfurt C.3. Elections to the Supervisory. Board (1) Peter Maria  Wagner (2) Michael Hirschi (3)  Andrea Sieber

    Numbering as alphabets [Roman numbers]

    I. Presentation of the financial statements and annual report for the 2010 financial year with the report II. Supervisory Board, the group financial statements, the group annual report III. the report pursuant to Sections 289(4) and 315(4) of the German Commercial Code IV. Ratification of the acts of the Board of MDs V. Ratification of the acts of the Supervisory Board VI. Appointment of auditors for the 2011 financial year: PricewaterhouseCoopers AG, Frankfurt VII. Elections to the Supervisory. Board (1) Peter Maria Wagner (2) Michael Hirschi VIII. Election of Andrea Sieber as a director

     

     

    Please help in developing the macro for Roman numbering , alphabets and normal numerical for spliting

     


    Friday, January 17, 2014 11:25 PM
  • Sir, i have gave my reason, why i need this pls look in to the below query and suggest me the method for roman and alphabets and numbering as well.

    Hope for your reply.

    Tuesday, January 21, 2014 9:34 AM
  • Dim range As range

    Dim i As Long

    Dim TargetList

    TargetList = Array("For", "Against", "Abstain", "Don not vote", "favour", "favor", "resolution", "res", "prop", "ordinary", "special", "agenda") ' put list of terms to find here

    For i = 0 To UBound(TargetList)

    Set range = ActiveDocument.range

    With range.Find

    .Text = TargetList(i)

    .Format = True

    .MatchCase = True

    .MatchWholeWord = False

    .MatchWildcards = False

    .MatchSoundsLike = False

    .MatchAllWordForms = False

    Do While .Execute(Forward:=True) = True

    range.HighlightColorIndex = wdGreen

    Loop

    End With

    Next

    Saturday, January 25, 2014 1:49 PM
  • Private Sub CommandButton1_Click()

    Dim range As range
    Dim i As Long
    Dim TargetList

    TargetList = Array("For", "Against", "Abstain", "Don not vote", "favour", "favor", "resolution", "res", "prop", "Ordinary", "special", "agenda", ":22F::CAEV//") ' put list of terms to find here

    For i = 0 To UBound(TargetList)

    Set range = ActiveDocument.range

    With range.Find
    .Text = TargetList(i)
    .Format = True
    .MatchCase = True
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False

    Do While .Execute(Forward:=True) = True
    range.HighlightColorIndex = wdGreen

    Loop

    End With
    Next

       Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "for"
            .Replacement.Text = "for"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll

    Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "against"
            .Replacement.Text = "against"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
             Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "withhold"
            .Replacement.Text = "withhold"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "favour"
            .Replacement.Text = "favour"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "do not vote"
            .Replacement.Text = "do not vote"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll

    Selection.Find.Replacement.Font.Color = wdColorRed
        With Selection.Find
            .Text = "abstain"
            .Replacement.Text = "abstain"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.Replacement.Font.Color = wdColorGreen
        With Selection.Find
            .Text = "Resolution"
            .Replacement.Text = "Resolution"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
     Selection.Find.Replacement.Font.Color = wdColorGreen
        With Selection.Find
            .Text = "Res"
            .Replacement.Text = "Res"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
     Selection.Find.Replacement.Font.Color = wdColorGreen
        With Selection.Find
            .Text = "Prop"
            .Replacement.Text = "Prop"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = True
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
     Selection.Find.Execute Replace:=wdReplaceAll
    End Sub

     

    Saturday, January 25, 2014 1:49 PM
  • a.

    A.

    A)

    (A)

    a)

    (a)

    1.a

    1.

    1)

    (1)

     1  (1   space before and 2 spaces after 1)

    1\\

    1   (one space after 1)

    01

    I.

    I)

    I   (one space after)

     A    (one space before and two spaces after A)

     A (one space before and after A)

    A  ( two spaces after A)

    Resolution   1

    Saturday, January 25, 2014 1:50 PM