Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Aug 2011
    Posts
    57
    Thanks
    21
    Thanked 2 Times in 2 Posts

    Replacing a string with bold text

    I've been looking for this solution, but evidently I can't get the syntax correct.

    I have numerous tables in my document and I would like to do a find and replace to bold those occurences.

    Example:
    Table 3.1.
    Table 3.2.
    Table 4.1.
    etc.

    How can I bold the entire string from Table all the way to the period?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,826
    Thanks
    185
    Thanked 704 Times in 642 Posts
    JRB,

    What you need to do is search using a "Regular Expression".
    Here's a Microsoft Article on Using Regular Expressions in Word.

    Then remember to apply the Format option to the "Replace With".
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. #3
    Star Lounger
    Join Date
    Aug 2011
    Posts
    57
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Thank you very much RG for the point in the right direction.

    I got this to work...

    Find= <(Table) [0-9](\.)[\0-9](\.)
    Replace= ^&

    ...but can't seem to grasp how to catch a double number.

    Example: Table 4.12.

    I could do

    <(Table) [0-9](\.)[0-9][0-9](\.)

    but this would catch the Table 4.12. and not the Table 3.1. so I would have to do two searches.

    Any way to do one?

  5. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,826
    Thanks
    185
    Thanked 704 Times in 642 Posts
    JRB,

    I think this will do it for all combos: Find= <(Table) [0-9]{1,}(\.)[\0-9]{1,}(\.)
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  6. The Following User Says Thank You to RetiredGeek For This Useful Post:

    jrb (2012-04-12)

  7. #5
    Star Lounger
    Join Date
    Aug 2011
    Posts
    57
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Yes it does the job quite well.

    I had actually used this before you posted and it works well for my requirements also.

    <(Table) [0-9](\.)[\0-9]{1,2}(\.)

    Much appreciated.

Posting Permissions

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