+ Reply to Thread
Results 1 to 4 of 4

Changing background color of a combobox list entry

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    92

    Changing background color of a combobox list entry

    Hey Guys

    Today i thought "Hey I should try to give something back to you guys". So i start scrolling down the new posts and i come across "Run at Open" and i think to myself "This just got posted and I totally know how to do this". But someone had already gotten to it so i'll have to wait my turn to help someone

    Until then i have a syntax question. I want to change the background color of one of the entires in my combobox listfillrange. If possible i do not want to modify the cell in which the listfillrange data is stored.

    Combobox1 pull down menu
    1
    2<------modify this background color.
    3
    4

    I know how to change the color of a regular cell using
    ActiveCell.Interior.ColorIndex = 36
    or
    Range("A1:A6").Interior.Color = RGB(200, 160, 35)
    but i do not know how to call a specific index in the listfillrange properly.

    Please help
    Thanks

  2. #2
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    I've been searching other forums for my problem and it haven't found a good solution. Some people used data validation to refine the combobox list but i would like the whole list to show with preffered items highlighted in green.

    Just to clearify i'm using a combobox from the Controll Toolbox. It doesn't really matter what type of combobox i use but these i am more familiar with. the combobox sits in sheet1 and so does its code as

    private sub combobox1_click
    stuff
    end sub

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

    Neither the Forms DropDown or Control ToolBox ComboBox support highlighting an individual item with any color other than blue. This is possible in Visual Basic because you can obtain the control's window handle. Unfortunately, you can't do the same in VBA.

    Sincerely,
    Leith Ross

  4. #4
    Registered User
    Join Date
    01-29-2007
    Posts
    92
    Mr. Leith

    Ok i can accept that. Usually when someting in excel can't be done it means that i'm using the wrong approach and that there is a better way to do the same thing. So here the reasoning behind what i want to do.

    I have two comboboxes in my workbook. (Combobox1 and Combobox2) both from control toolbox.

    The first combobox contains a list of connectors. (Connector1, Connector2)
    The second combobox contains a list of cables. The connector is attached to a cable but not all cables fit each connector.

    Lets say combobox2 has a list of two cables. (CableA and CableB) now lets say that connector1 fits cableA perfectly but we can make cableB fit Connector1 (if we have to). So my reasoning was to highlight the proper cable in green to the guys know that this is the cable which fits the chosen connector, but i don't want to completely take cableB off the list becase if say we are out of cableA, we could still make cableB fit.

    If anyone has come across a similar situation i would appreciate a point in the right direction. For now i'll go back to the drawing bord.

    Thank you
    Schwizer

+ 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