+ Reply to Thread
Results 1 to 7 of 7

Mixed font colours in OLEObject

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Berlin, Germany
    MS-Off Ver
    365
    Posts
    11

    Mixed font colours in OLEObject

    Hey everyone,

    I am changing an output string from its position in a cell onto a OLEObject.Caption.

    Previously the cell (range) had a nice mix of colours, making the fairly complex string very legible. I managed this through the following code:
    rng.Characters(Start:=12, Length:=27).Font.Color = RGB(255, 0, 0)

    My question is, is there a code I can apply to the object.forecolor code?
    o1.Object.ForeColor = RGB(0, 0, 0)
    ...and then, as above, letters starting from position 12 to 27 should be red.

    I guess a workaround could be positioning a graphical element, but this would also require establishing its .left value, based on I am not sure what...

    Thank you for any help!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Mixed font colours in OLEObject

    What kind of object is it?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    Berlin, Germany
    MS-Off Ver
    365
    Posts
    11

    Re: Mixed font colours in OLEObject

    It is a Label (ActiveX Control).

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Mixed font colours in OLEObject

    You cannot mix text formatting in an ActiveX Label caption. You are correct that this is possible using a graphical element, such as a textbox (not a textbox control).

    I can't offer any other details without seeing how you're using it on the sheet.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Mixed font colours in OLEObject

    You could also use a shape, rather than an ActiveX control.

  6. #6
    Registered User
    Join Date
    02-13-2014
    Location
    Berlin, Germany
    MS-Off Ver
    365
    Posts
    11

    Re: Mixed font colours in OLEObject

    Thank you - I will try a shape, that would be acceptable for the output!

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Mixed font colours in OLEObject

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Assigning font colours shortcut?
    By Badger123 in forum Excel General
    Replies: 1
    Last Post: 08-02-2009, 07:58 AM
  2. Replies: 6
    Last Post: 06-08-2006, 08:40 PM
  3. Cell colours and font colours
    By Casperion in forum Excel General
    Replies: 8
    Last Post: 03-27-2006, 02:55 AM
  4. [SOLVED] mixed font styles in the output of a formula?
    By trumbore in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2005, 10:05 PM
  5. [SOLVED] Excel 2003 font colours and cell colours
    By bretta in forum Excel General
    Replies: 1
    Last Post: 04-16-2005, 11:06 PM
  6. [SOLVED] How to set different font colours in a cell?
    By Sam in forum Excel General
    Replies: 3
    Last Post: 03-29-2005, 09:06 AM
  7. [SOLVED] How to set different font colours in a cell?
    By Sam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2005, 09:06 PM

Tags for this Thread

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