Function testfunc(val As Variant) As Variant testfunc = val + 1 End Function
Function testfunc(obj As Object) As Variant 'obj.Count には複数セルが選択された場合の要素数が入る 'obj(1) 選択されたセルの先頭要素 Dim i As Integer For i = 1 To obj.Count testfunc = testfunc + obj(i) Next i End Function