+ Reply to Thread
Results 1 to 9 of 9

VBA to format bold a concatenated string

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    VBA to format bold a concatenated string

    Similar to this thread - http://www.excelforum.com/excel-gene...ted-items.html

    All I need to do is something similar BUT only one item is to be bold. But that bold item will change in charater length, so counting where to begin the bold (like shown above = 58 character) doesnt work for me. I need to join (3) items where the second itme is the one to be bold and changes.

    Problem:
    A flat fee of $11,750.00 is agreed upon for the delivery of the services.

    This dollar amount changes any where from $1.00 to $999,999.00

    Results to be placed in A155.

    THANK YOU IN ADVANCE!
    Last edited by clemsoncooz; 12-27-2011 at 03:14 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to format bold a concatednated string of items

    Assuming the starting phrase is in A1, the second in A2, and the third in A3,

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: VBA to format bold a concatenated string

    Thank you for the quick response and solution

    While that solution does indeed work, your assumption is not correct, since I failed to specify that. Sorry! My fault!

    The phrases actually exisits on a different worksheet (Titled: "DO NOT DELETE") and on Row 24. Therefore, A24, B24, and C24.

    I edited your coded to now be:

    Please Login or Register  to view this content.
    But this isn't working. Can you not just add 'worksheetTitle'!## as you normally would like on other excel functions?
    Last edited by clemsoncooz; 12-27-2011 at 02:58 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to format bold a concatenated string

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.

  5. #5
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: VBA to format bold a concatenated string

    Quote Originally Posted by shg View Post
    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Now fixed. Sorry about that.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to format bold a concatenated string

    The code has to go in the sheet module for worksheet DO NOT DELETE (the sheet where the change occurs). Change "Sheet1" as appropriate.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: VBA to format bold a concatenated string

    Works great!

    Thank you very much!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to format bold a concatenated string

    You're welcome, good luck.

  9. #9
    Registered User
    Join Date
    11-03-2012
    Location
    San Jose
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: VBA to format bold a concatenated string

    Taking this a few steps further, I'm trying to have a few strings with regular text and a few strings of bold text together.

    example:
    A1: text_string_1
    A2: text_string_2_BOLD
    A3: text_string_3
    A4: Month_string_4_BOLD
    A5: Day_string_5_BOLD
    A6: Year_string_6_BOLD
    A7: text_string_7
    A8: Month_string_8_BOLD
    A9: Day_string_9_BOLD
    A10: Year_string_10_BOLD

    Here's the code I'm using:
    Please Login or Register  to view this content.
    My output gives me a nice concatenated output with text strings 1 - 10 with A2 being bold. However, I can't figure out how to modify the ".Characters" section of my code to bold text A4, A5, A6, and A8, A9, and A10.

    Any help would be greatly appreciated. Thanks.

+ 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