A G
asked on
Returning multiple values on vba with a function
I have a function, which is a web query. It gets the table from internet and pastes it on Cell E111.
The information I need is on Cells F111 and F114.
so after the webquery I tried something like this and didnt work
myfunction = b(Sheets("LiveSheet").Rang e("F111"). Value, Sheets("LiveSheet").Range( "F114").Va lue)
I need to put the values, i return from the function into two different cells on excel.
Also the function is used in a vba subroutine.
The information I need is on Cells F111 and F114.
so after the webquery I tried something like this and didnt work
myfunction = b(Sheets("LiveSheet").Rang
I need to put the values, i return from the function into two different cells on excel.
Also the function is used in a vba subroutine.
Return an array from your function.
I *think* something like this might work in VBA...
I *think* something like this might work in VBA...
Function DoIt(parm As Long) As Variant
Doit = Array(parm,9,15)
End Function
Dim x as Variant
x = Doit(4)
Msgbox x(0)
Msgbox x(1)
Msgbox x(2)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Range("A1").Value = myfunction1()
Range("B1").Value = myfunction2()