These classes are killing me. I have set up a few classes , but am struggling with this one. This is the code I have for the comboboxes right now. I have this code duplicated for each of 20 boxes.
Essentially what I want to do is have a class module for a cboIng() and when the value for it changes, it will update the list of cboUnit(). I set up the class module clsIng, but can't get it to change cboUnit.
Code:
Private Sub cboIng1_Change()
Dim varMatch
cboUnit1.Clear
' check the combo is not blank
If cboIng1.Value <> "" Then
varMatch = Application.Match(cboIng1.Value, Range("Ing").Columns(1), 0)
' check for no matching data
If Not IsError(varMatch) Then
With cboUnit1
.AddItem Range("Ing").Cells(varMatch, 6)
.AddItem Range("Ing").Cells(varMatch, 8)
.AddItem Range("Ing").Cells(varMatch, 10)
End With
End If
End If
End Sub