How may I populated a Combo Box ActiveX, lets say with 5 comments. Also with a different Tint for each selection. I'm new to VBA and this is what I was able to come up with. I know how to use Form Fields I'm trying to do this without having to use protection.
Code:Dim Pwd As String, Tint With ActiveDocument Select Case Case "Inspected" Tint = RGB(171, 229, 123) Case "Not Inspected" Tint = RGB(190, 190, 190) Case "Not Present" Tint = RGB(120, 220, 255) Case "Damaged / Repair Needed" Tint = RGB(255, 220, 110) Case "Safety Hazard" Tint = RGB(250, 100, 95) End Select .Tables(1).Cell(tRow, tCol).Range.Shading.BackgroundPatternColor = Tint End With End Sub
I found that there are a couple of different ways to populate the combobox, here is one I found.
the colour may be a little more tricky...............Code:Dim arg As Variant, myArray As Variant myArray = Array("One", "Two", "Three") 'Fill list items For Each arg In myArray Me.ComboBox1.AddItem arg Next arg
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks