I suspect a collection/dictionary approach may be more useful:
Option Explicit
Private oDays As Object
Public Sub AddDate(Value As Date)
Dim sDate As String
sDate = CStr(Value)
If oDays.Exists(sDate) Then
oDays(sDate) = oDays(sDate) + 1
Else
oDays.Add sDate, 1
End If
End Sub
Public Property Get DatesWorked() As Object
Set DatesWorked = oDays
End Property
Private Sub Class_Initialize()
Set oDays = CreateObject("Scripting.Dictionary")
End Sub
Sub test()
Dim oEngineers As Collection
Dim oEngineer As cEngineer
Dim vDatesWorked
Dim vDays
Dim x As Long
Set oEngineers = New Collection
For x = 1 To 10
Set oEngineer = New cEngineer
oEngineers.Add oEngineer, "Kyle" & x
Next x
oEngineers("Kyle1").AddDate #5/1/2013#
oEngineers("Kyle1").AddDate #5/2/2013#
oEngineers("Kyle1").AddDate #5/1/2013#
oEngineers("Kyle1").AddDate #5/4/2013#
vDatesWorked = oEngineers("Kyle1").DatesWorked.Keys
vDays = oEngineers("Kyle1").DatesWorked.Items
End Sub
Bookmarks