Need help. very new with excel vba. I am populating a combobox from a range but need to check if the adjacent cell is empty or not. The table is being updated dynamically so I need to exclude some values in the list once the table is updated. my code is something like below, so i need to check if C2:C100 has value or empty, if empty put B2 in the combobox list and loop.. thanks in advance guys.
Private Sub List_Prizes()
Dim myrng As Range
Dim data As Range
Set ws = ThisWorkbook.Worksheets("Prizes")
Set myrng = ws.Range("B2:B100")
With Me.cb_PrizeList
.Clear
For Each data In myrng.Cells
If data.Value <> "" Then
.AddItem data.Value
End If
Next data
End With
End Sub
Private Sub List_Prizes()
Dim myrng As Range
Dim data As Range
Set ws = ThisWorkbook.Worksheets("Prizes")
Set myrng = ws.Range("B2:B100")
With Me.cb_PrizeList
.Clear
For Each data In myrng.Cells
If data.Value <> "" Then
.AddItem data.Value
End If
Next data
End With
End Sub