Some kind soul provided me with this sample code which will populate a userform omitting rows where a cell is blank in column C (have attached the sheet).
I'm trying to adapt it to a sheet where there are 22 columns (A - Q), and it is if a cell in column M is blank that the user form should show.
Unfortunately I don't seem to understand the syntax of the code. I think the "Count, 3" bit is throwing me off.
If someone could quickly explain it to me I'd be most appreciative.
Private Sub UserForm_Initialize()
Dim xCell As Range
For Each cell In Range("C2", Cells(Rows.Count, 3).End(xlUp))
If Not IsEmpty(cell) Then Me.CB_RefNo.AddItem cell.Offset(0, -2).Value
Next
End Sub
Bookmarks