Here'an explanation of my coe
Private Sub UserForm_Initialize()
'set the variables
Dim rRng As Range, rCl As Range
With Sheet1 '< - use Sheet 1
On Error Resume Next '<- need to have errror handler in case no cells meet the SpecvialCells criteria
'R1C1 format Row number, Column number
'set the range from C2 to last used cell in C
'Rows.Count will be the last cell in the column & check back to the top
'to finf the next empty cell
'SpecialCells(xlCellTypeConstants) will pick only cells containing Constants
Set rRng = .Range(.Cells(2, 3), .Cells(.Rows.Count, _
3).End(xlUp)).SpecialCells(xlCellTypeConstants)
On Error GoTo 0
'loop through those cells & format & add to ComboBox
For Each rCl In rRng
Me.CB_RefNo.AddItem Format(rCl.Value, "long date")
Next rCl
End With
End Sub
Bookmarks