Sub Main() MsgBox Func(100, 2, 5) '按照要求写的例子 End Sub Rem 参数(最大值, 被整除的数的数组) Function Func(n&, ParamArray x()) Dim i&, b& For i = 1 To n b = 0 Dim j& For j = LBound(x) To UBound(x) If i Mod x(j) Then b = 1 Exit For End If Next j If b = 0 Then Func = Func & i & vbLf Next i End Function