extrahotfudge
New Member
- Joined
- Apr 9, 2021
- Messages
- 10
- Office Version
- 365
- 2019
- Platform
- MacOS
Hello! I am needing assistance on the code for Select Case in VBA. I have a column of Integers, x, and want to use the Select case to find their value in a piecwise function.
I'm not very skilled with VBA or Macros, so I did some research and this is what I came up with:
Function Calc(x)
Select Case x
Case Is < 0
x^ 3
Case 0 To 3
x^ 2
Case Is > 3
Sqr (x - 3)
End Select
End Function
But it returns an error when I try to apply it to my x cell.
I am lost, please help, thanks!
I'm not very skilled with VBA or Macros, so I did some research and this is what I came up with:
Function Calc(x)
Select Case x
Case Is < 0
x^ 3
Case 0 To 3
x^ 2
Case Is > 3
Sqr (x - 3)
End Select
End Function
But it returns an error when I try to apply it to my x cell.
I am lost, please help, thanks!