RonNCmale
02-23-2013, 03:55 AM
I have a excel spreadsheet that when I check for due/overdue a userform comes up with the list of names. I need to add dates beside the names when it comes up.
Private Sub UserForm_Initialize()
Dim rDates As Range
With Sheet1
Set rDates = .Range(.Cells(2, 2), .Cells(.Rows.Count, 2).End(xlUp))
End With
rDates.Interior.ColorIndex = xlNone
For Each cl In rDates
Select Case cl.Value
Case Is = Date
Me.ListBox1.AddItem cl.Offset(0, -1).Value
Case Is < Date
Me.ListBox2.AddItem cl.Offset(0, -1).Value
End Select
Next cl
End Sub
see attached excel file
Private Sub UserForm_Initialize()
Dim rDates As Range
With Sheet1
Set rDates = .Range(.Cells(2, 2), .Cells(.Rows.Count, 2).End(xlUp))
End With
rDates.Interior.ColorIndex = xlNone
For Each cl In rDates
Select Case cl.Value
Case Is = Date
Me.ListBox1.AddItem cl.Offset(0, -1).Value
Case Is < Date
Me.ListBox2.AddItem cl.Offset(0, -1).Value
End Select
Next cl
End Sub
see attached excel file