onlyleif
Industrial
- Dec 3, 2007
- 1
I am working on a switch function that checks the value in some fields and depending on the current value, it prints a new value.
I hope that this shows what I am trying to accomplish.
The problem here is getting the function to excecute with a field of my choice as the argument.
If this is not possible, then if saving the value from a specific field into a variable and use the variable instead.
Code:
Start Sub
field = Range("L14")
ActiveCell.FormulaR1C1 = Tålamod(field)
End Sub
Function Tålamod(Resultat As Integer)
Tålamod = Switch(Resultat = "9", "70", Resultat = "10", "73", Resultat = "11", "76", Resultat = "12", "79", Resultat = "13", "82", Resultat = "14", "85", Resultat = "15", "88", Resultat = "16", "92", Resultat = "17", "95", Resultat = "18", "98")
End Function
The problem here is getting the function to excecute with a field of my choice as the argument.
If this is not possible, then if saving the value from a specific field into a variable and use the variable instead.