• Seaching for a string of numbers. (W97)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Seaching for a string of numbers. (W97)

    Author
    Topic
    #383329

    I’m wanting to search through a series of outline numbers (not autonumbered). I’m wanting to find all 2 digit numbers like, 4.5, but not include3 digit numbers like 4.5.6.
    I tried doing a search for ^#.^#…. and then I tried ^#.^#^p (paragraph end)…. but then it would select the last 2 digits of a number. I’ve got to think there IS a way. I’m just not hitting upon the right wildcard.

    PS. Each number is followed by a paragraph mark
    2
    2.1
    2.2
    2.2.1
    2.2.2

    I’m wanting to select 2.1 and 2.2…. and NOTHING else.

    Help, Anyone?

    Viewing 0 reply threads
    Author
    Replies
    • #653353

      perhaps including the metacharacters that indicate ‘start of word’?

      or maybe ^p#.#.^p ?

      • #653361

        I was thinking along the logic of start of word, but don’t know if there’s a metacharacter for that.

        • #653472

          With wildcards turned on, there is a start of word character — <[0-9]@.[0-9]@ — but a period is considered a word delimiter, it will find a match at "secondlevel.thirdlevel" in your example.

          Why are you doing this? Maybe there is another solution…

          • #653487

            I’m doing a search and replace to apply styles. We have a requirement traceability matrix that was started by creating a TOC, breaking the link and converting it to a table. Now, I want to find all outline level 2s and apply a specific style, etc for the other levels.

            I have attached a mini sample of the table. The original table has over 1000 rows.

            • #653489

              OOOOOh, there is definately an easier way! I aquired tunnel vision when we started out by pasting into an excell spreadsheet and lost all formatting.

              The answer is as simple as altering my TOC styles. When I convert it to a table, the style is carried with.

              I guess I just had to step away from it for a few hours. I actually started to “hear” the answer as I wrote my previous entry.

              Case Closed

    Viewing 0 reply threads
    Reply To: Seaching for a string of numbers. (W97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: