+ Reply to Thread
Results 1 to 4 of 4

Colour of List Items

  1. #1
    Registered User
    Join Date
    08-16-2007
    Location
    Portsmouth, UK
    Posts
    86

    Colour of List Items

    Hi again.

    I was wondering if there was a way that you could specify the colour of specific items in a list? I have a list of objects in a userform, selecting from the list will display the information relating to that object. The information relating to some of the objects will contain errors.

    I would like to be able to highlight those objects that contain errors in the data so that the user can easily identify these without having to check every item in the list to find the problem areas.

  2. #2
    Registered User
    Join Date
    08-16-2007
    Location
    Portsmouth, UK
    Posts
    86
    Have just had a google on the subject and it seems that VBA does not support multiple formatting of listbox items. So all items in my listbox would have to have the same forecolor.

    If someone could confirm that this is indeed the case I shall stop tring to figure put a way to do this.

    Thanks

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon RobynC

    it seems that VBA does not support multiple formatting of listbox items
    'Fraid you're right.
    With listboxes (and comboboxes) within Excel it's all or nothing. You can change the forecolour or the text colour, but all items have to be formatted the same.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello RobynC,

    The answers are yes, and yes. Yes to VBA doesn't support this as a built-in feature of its controls. Yes, it can be done another way using the Windows API. This method is extremely complex, and probably not worth the time investment to create to make use of this feature in this case.

    Sincerely,
    Leith Ross

+ 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