I keep getting "Argument not optional" on this Sub. The .Add word always gets highlighted as well.
I've tried using Set and declaring the collection in the Sub and in the calling function. Setting the argument as ByRef nor Optional works either.
Sub getDescriptions(ByRef descriptions As Collection)
Dim i As Integer
i = 0
Set descriptions = New Collection
Do While Cells(i + 3, 1).Value <> "" And Cells(i + 3, 2).Value <> ""
descriptions.Add = Cells(i + 3, 2).Value & " - Test Period " & Cells(i + 3, 4).Value & " - " & Cells(i + 3, 5).Value
i = i + 1
Loop
End Sub
Public descriptions as Collection
Private Sub UserForm_Initialize() 'calling Sub
With Application.ActiveWindow
Me.Left = .Left + (.Width - Me.Width) / 2
Me.Top = .Top + (.Height - Me.Height) / 2
End With
Set descriptions = New Collection
getDescriptions (descriptions)
...