I have this function below. Trying to set the value is causing it to fail. If i comment out the value section it works as planned but i need to show the other 2 values in the cells given. I get the #Value! error when they are not commented out. Thanks for assistance.
Function GetAreas(str As String, Optional ttl1 As Range, Optional ttl2 As Range) As String
ttl1.Value = 250
ttl2.Value = 200
GetAreas = str
End Function
I am calling the function using a formula like this.
=IF($H3<>"",GetAreas($H3, $J3, $K3),"")