What I have:
- I have drop-down list in my form that I'm populating from a worksheet.
- My code only works for named ranges.
What I need:
I need to populate my drop-down list from a whole column rather than a named range.
My VBA code:
Working code using a named range:
'Populate drop-down list (combo box) from range...
Dim range_b As Range
For Each range_b In Worksheets("2.1 Clients").Range("ClientList")
With Me.cs_ClientName1
.AddItem range_b.Value
.List(.ListCount - 1, 1) = range_b.Offset(0, 1).Value
End With
Next range_b
What I've tried:
I've tried various permutations of the For Each line:
'For Each range_b In Worksheets("2.1 Clients").Columns(4)
'For Each range_b In Worksheets("2.1 Clients").Range(Columns(4))
'For Each range_b In Worksheets("2.1 Clients").Columns("D:D")
...that last of which seems to causing Excel to crash.