+ Reply to Thread
Results 1 to 2 of 2

Population a Combo Box ActiveX

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Cool Population a Combo Box ActiveX

    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.

    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

  2. #2
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Smile Re: Population a Combo Box ActiveX

    I found that there are a couple of different ways to populate the combobox, here is one I found.
    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
    the colour may be a little more tricky...............

+ 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