ComboBox Question

  • Thread starter Thread starter jlclyde
  • Start date Start date
J

jlclyde

I am trying to fill a combo box in a user form from a range. I do not
want every cell in range. I want the cell value to be added only if
cell.row mod 4 = 0. Can this be done? How?

Thanks,
Jay
 
Something like this maybe (assuming your data is in Column B for this
example)...

Dim X As Long, LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 4 To LastRow Step 4
Me.ComboBox1.AddItem Cells(X, "B").Value
Next
 
Something like this maybe (assuming your data is in Column B for this
example)...

  Dim X As Long, LastRow As Long
  LastRow = Cells(Rows.Count, "B").End(xlUp).Row
  For X = 4 To LastRow Step 4
    Me.ComboBox1.AddItem Cells(X, "B").Value
  Next

--
Rick (MVP - Excel)







- Show quoted text -

Rick,
I can work with this. Thanks for the code. I was trying to do it
with an array and not having any luck setting that.
Thanks,
Jay
 
Back
Top