Hi All,
I have been trying to use a name range as a combobox rowsource.
I need to loop all the name ranges in my range ("T2: T18") and pickup the matching name range that is provided by my other combobox "cmbDesc".
else if no match then use this "no name range" instead. however my loop constantly end up in the "no name range" and never get to see the match even I have the name range accurately inputted in my searching combobox.
please see
I have been trying to use a name range as a combobox rowsource.
I need to loop all the name ranges in my range ("T2: T18") and pickup the matching name range that is provided by my other combobox "cmbDesc".
else if no match then use this "no name range" instead. however my loop constantly end up in the "no name range" and never get to see the match even I have the name range accurately inputted in my searching combobox.
please see
Code:
Dim ranges As Variant
Dim cel As Variant
ranges = cmbDesc
For Each cel In ThisWorkbook.Sheets("Sheet1").Range("T2:T18")
If cel.Value = ranges Then
Me.cmbItemParts.RowSource = cel
Else
Me.cmbItemParts.RowSource = "List_of_Items"
End If
Next cel
End Sub
much thanks,
reggieneo