My search did not come up with a UserForm example, so here I am.
I need to fill a ComboBox with data from a Sheet (Subdivisions) in a Range (SubdivisionsSubNames), but ONLY if there is a Yes in Column 17.
Here's what I have. I'm getting a run-time 424 error. I suspect that With Me.SubName.List is wrong.
I need to fill a ComboBox with data from a Sheet (Subdivisions) in a Range (SubdivisionsSubNames), but ONLY if there is a Yes in Column 17.
Here's what I have. I'm getting a run-time 424 error. I suspect that With Me.SubName.List is wrong.
VBA Code:
Private Sub UserForm_Initialize()
Set wsSubdivisions = ThisWorkbook.Worksheets("Subdivisions")
Dim c As Range
With Me.SubName.List
.Clear
For Each c In Subdivisions.Range("SubdivisionsSubNames", Subdivisions.Range("SubdivisionsSubNames" & Rows.Count).End(3))
If c.Offset(0, 17).Value = "Yes" Then
.AddItem c.Value
End If
Next
End With
End Sub