Multiple output cells with UDF

I want to print multiple output fields in cells in Excel using a user defined function.

Function CAL(dinero, impuesto)
Dim strText As String
Dim num As Double

num = dinero * 6.8
strText = "Mas impuesto"

Range("A2").Value = strText
Range("B2").Value = num

CAL = dinero + impuesto
CAL = Application.Round(CAL, 2)
End Function

Current result:

enter image description here

Expected result:

enter image description here

Read more here:

Content Attribution

This content was originally published by Edwin Bossman at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: