Is there a way to create a method with unknown number of parameters?
And if it this the case :
Yes & yes.
it is possible, and all of them must be the same type, if you need to pass various types use object datatype instead, and then unbox them within function. use ParamArray:
' Accept variable number of arguments Function Sum(ByVal ParamArray nums As Integer()) As Integer Sum = 0 For Each i As Integer In nums Sum += i Next End Function ' Or use Return statement like C# Dim total As Integer = Sum(4, 3, 2, 1) ' returns 10
for more info see this