Hi,
I am trying to pass two arguments in a function, but don't know how to exactly do this in VBA coding. For example, I would like to define the function happy() for color and day. Let me know if there is anything wrong with the coding below:
Function happy([color], [day]) as string
If color = "blue" and day = "Friday" then
happy = good
Else: happy = "Unknown"
End If
End Function
I believe the above codes work. I will try tomorrow. In the meantime, feel free to comment on the style and/or show how this can be done using the "case" statements instead of if/then statements.
Thanks.
I am trying to pass two arguments in a function, but don't know how to exactly do this in VBA coding. For example, I would like to define the function happy() for color and day. Let me know if there is anything wrong with the coding below:
Function happy([color], [day]) as string
If color = "blue" and day = "Friday" then
happy = good
Else: happy = "Unknown"
End If
End Function
I believe the above codes work. I will try tomorrow. In the meantime, feel free to comment on the style and/or show how this can be done using the "case" statements instead of if/then statements.
Thanks.