Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Color Matrix and Selection in a Combobox

Status
Not open for further replies.

Sbaugh

Technical User
Feb 25, 2004
20
US
I have a userform that I am trying to populate the Combo box with the names of all 56 colors and I want the Color to appear in a Textbox below it. I have the colors, Hexidecimal and the RGB colors in my spread sheet and I could utilize this. I was able to get the color words into the combobox, but I can't get the color to appear in the textbox. But more importantly I can't get the RGB colors to appear into 3 other cells as the Color is selected.

Is there a way to get the color to appear into the Textbox as wells copy the RGB #'s to select cells per the color selected in the combo box?

If you need further clarification please let me know.

Thanks in advance

Scott Baugh, CSWP [pc2]
 
Here is what I did to get the RGB into the proper cells.

Code:
Private Sub ComboBox1_Change()

Dim i As Long
    
   With Me
        i = WorksheetFunction.Match(.ComboBox1.Value, Sheet2.Range("G1:G56"), 0)
        
        i = Sheet2.Cells(i, 1).Value
                
        Sheet2.Range("J20").Value = i
        
   End With
End Sub

On Sheet 2 I have a result of Numerical value associated to the color selected in the Combobox. Then I used the Numerical value in the cell. I placed a Vlookup in the "R","G" & "B" cells to find the correct RGB #. The only thing I cannot figure out is how to place the actual "Backcolor" into a Textbox.

Any ideas of how to do that?

Thanks,

Scott Baugh, CSWP [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top