Results 1 to 6 of 6
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Has anyone created a macro to set a reverse numbered or countdown style list?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    And answering my own question
    I found this and another variation on the theme.

    Code:
    Sub ReverseNumberList()
    Dim i As Long
    Dim listCount As Long
    Dim Numrange As Range
    Dim oTmpRng As Range
    Set Numrange = Selection.Range
    ActiveWindow.View.ShowFieldCodes = False
    Numrange.ParagraphFormat.TabStops.Add Position:=InchesToPoints(0.3)
    listCount = Numrange.Paragraphs.Count
    For i = 1 To listCount
    	Set oTmpRng = Numrange.Paragraphs(i).Range
    	If IsNumeric(oTmpRng.Characters(1)) Then
     	On Error GoTo ErrHandler
     	If InStr(oTmpRng.Fields(1).Code, "SEQ") > 0 Then
     	 oTmpRng.Fields(1).Delete
     	oTmpRng.End = oTmpRng.Start + 2
     	 oTmpRng.Delete
     	End If
    	End If
    Reentry:
    	Set oTmpRng = Numrange.Paragraphs(i).Range
    	oTmpRng.Collapse wdCollapseStart
    	oTmpRng.InsertAfter "." & vbTab
    	oTmpRng.End = oTmpRng.End - 2
    	If i = 1 Then
     	Numrange.Fields.Add oTmpRng, wdFieldSequence, "ReverseList \r1", False
    	Else
     	Numrange.Fields.Add oTmpRng, wdFieldSequence, "ReverseList", False
    	End If
    	oTmpRng.End = oTmpRng.End + 1
    	Numrange.Fields.Add oTmpRng, wdFieldEmpty, , False
    	oTmpRng.End = oTmpRng.End - 1
    	oTmpRng.InsertAfter Text:="=" & listCount + 1 & "-"
    	With Numrange.Paragraphs(i)
     	.LeftIndent = InchesToPoints(0.3)
     	.FirstLineIndent = InchesToPoints(-0.3)
    	End With
    Next i
    ActiveWindow.View.ShowFieldCodes = False
    ActiveDocument.Fields.Update
    Exit Sub
    ErrHandler:
    If Err.Number = 5941 Then
    	Set oTmpRng = Nothing
    Resume Reentry
    Else 
    	MsgBox "Unknown error exiting this routine"
    End If
    End Sub
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by WebGenii View Post
    Has anyone created a macro to set a reverse numbered or countdown style list?
    And even worse I've answered this question before, in detail

    Holy. Cow. I. AM. LOSING. MY MIND.

    my previous answer
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by WebGenii View Post
    Holy. Cow. I. AM. LOSING. MY MIND.
    I heard about some recent books and articles saying the proliferation of search engines is causing our memories to slip...

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Quote Originally Posted by WebGenii View Post
    And even worse I've answered this question before, in detail

    Holy. Cow. I. AM. LOSING. MY MIND.

    my previous answer
    Hi Catharine,

    FWIW, you can do it without a macro too, via field coding. Using a field coded as:
    {SET HighNum 11}{=HighNum-{SEQ RevNumList}}
    gives a sequence that counts down from 10. Simply copy & paste to wherever you want, then update the fields.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by macropod View Post
    Hi Catharine,

    FWIW, you can do it without a macro too, via field coding. Using a field coded as:
    {SET HighNum 11}{=HighNum-{SEQ RevNumList}}
    gives a sequence that counts down from 10. Simply copy & paste to wherever you want, then update the fields.
    The macros, in the previous post do use the SEQ field. I actually wrote a suite of them (based of course on other's work). They apply the reverse numbering (and allow the user to name each list so there can be more than one in each document). There is also a list removal function and a renumber function if the list is edited.

    I went to some time and trouble - which is why I can't believe I totally forgot about them.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •