All
I'm trying to populate a userform Combobox from a specific column in a worksheet, but only use the .additem if column 4 contains a specific text
<tbody>
</tbody>
So Basically, i only want to show Value1 and Value 3 in my combobox options
Here's my current code. (This bit works perfect) But it's only getting a range from a single column. I'm thinking i need to extend the range to include column 4,
Private Sub UserForm_Initialize()
Dim t As Range
Dim x As Range
With Worksheets("Document Index")
lr = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each t In .Range("A8:A" & lr)
cmbBoxSelect.AddItem t.Value
Next t
End With
End Sub
I'm trying to populate a userform Combobox from a specific column in a worksheet, but only use the .additem if column 4 contains a specific text
Heading1 | Heading2 | Heading3 | Heading4 | Heading5 |
Value1 | abc | |||
Value2 | ||||
Value3 | abc | |||
Value4 |
<tbody>
</tbody>
So Basically, i only want to show Value1 and Value 3 in my combobox options
Here's my current code. (This bit works perfect) But it's only getting a range from a single column. I'm thinking i need to extend the range to include column 4,
Private Sub UserForm_Initialize()
Dim t As Range
Dim x As Range
With Worksheets("Document Index")
lr = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each t In .Range("A8:A" & lr)
cmbBoxSelect.AddItem t.Value
Next t
End With
End Sub