title: Fill combobox based on filtered table data
body: <p>In Excel 2013 I have a sheet containing a formatted table - Table1. The table has two columns, [Product Group] and [Product Name] :</p>
  
  <p><img src="https://i.stack.imgur.com/tXNNn.png" alt="enter image description here"></p>
  
  <p>Using VBA I have created a simple form containing two comboboxes, <code>cbProductGroup</code> and <code>cbProductName</code>. </p>
  
  <p><code>cpProductGroup</code> is filled using the RowSource property and an named ranged (=ProductGroupName). What I need is <code>cbProductName</code> only to be filled with product names matching the product group from <code>cbProductGroup</code>, for instance choosing "Laptop" in <code>cbProductGroup</code> should only produce a dropdown list containing the two Lenovo laptops.</p>
  
  <p>Is this achievable somehow?</p>
  
  <p><strong>EDIT 17-04-2015 SOLVED:</strong></p>
  
  <p>I solved the problem using the change event of the <code>cbProductGroup</code> and adding the following code:</p>
  
  <pre><code>Private Sub cbProductGroup_Change()
  
      Me.cbProductName.Clear
  
      Dim lastRow As Long
      Dim shtInventory As Worksheet
      Set shtInventory = Sheets("Inventory")
  
      With shtInventory
  
          lastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
  
          For i = 6 To lastRow
              If Me.cbProductGroup = .Cells(i, "A") Then
                  Me.cbProductName.AddItem .Cells(i, "C")
              End If
          Next
      End With
  </code></pre>
  
  <p>Thank you all for providing valuable input and suggestions.</p>