A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
As written: =MyFunc(A1:B1,D1:E1) you are passing two arguments to your function which is only set up to accept a single argument.
One solution is to use ParamArray.
Another, if you want to pass a multiple range argument to your function, as written, you need to enter the formula:
=MyFunc((A1:B1,D1:E1))
Note that the multirange itself is enclosed within parentheses.
And take a look at this for some further insight:
Option Explicit
Function MyFunc(DataRng As Range) As String
Debug.Print DataRng.Areas.Count, _
DataRng.Areas(1).Address, DataRng.Areas(2).Address
MyFunc = "Dog"
End Function