+ Reply to Thread
Results 1 to 10 of 10

Make a word bold if it starts with a particular character/string

  1. #1
    Registered User
    Join Date
    06-04-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002
    Posts
    14

    Make a word bold if it starts with a particular character/string

    I need to make all words in a document that start with an A bold. Sounds simple, and conditional formatting on a cell would be the trick in excel but doesn't help mr in word.

    I figure I need a macro but have no clue in word vba and have been unable to find anything similar.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Make a word bold if it starts with a particular character/string

    This is from the top of my head as I'm certainly not a word specialist.
    Please Login or Register  to view this content.
    Only need to do the first by hand

    Edit: Added the red part later !
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Font.Bold = True
    Last edited by rwgrietveld; 02-18-2010 at 06:35 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Make a word bold if it starts with a particular character/string

    Again, I'm not an expert on this but for complete words to become bold
    HTML Code: 
    The restricton I have is that you have to start with ALL words NOT in Bold

    change .Text = " s* " where s is replaced by your character

  4. #4
    Registered User
    Join Date
    06-04-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002
    Posts
    14

    Re: Make a word bold if it starts with a particular character/string

    Thankyou, so much!

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Make a word bold if it starts with a particular character/string

    There you go, Rico!! Thanks for sharing!

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Make a word bold if it starts with a particular character/string

    use find replace
    find <[A-a]*>
    check wild cards box then from format option select font/ bold replace all (or usr ctrl+b in the replace field)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Make a word bold if it starts with a particular character/string

    Martin, Almost

    I like the approach, but with strings like Aaasasaasasaa all a's are turning Bold.

    As I'm not an expert I can't find a better answer. I hope you might.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Make a word bold if it starts with a particular character/string

    my mistake it should be
    <[aA]*> works with this see attached
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Make a word bold if it starts with a particular character/string

    Martin,

    What do you put in the "replace with" field (besides the bold

    and what about these strings?
    Zuidpool zuidpool
    Aarde aarde

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Make a word bold if it starts with a particular character/string

    works ok for me with those see attached
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1