It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Switch Argument = Field

Moderator: dafunkymunky

Switch Argument = Field

Postby onlyleif on Mon Dec 03, 2007 9:25 pm

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.

Code: Select all
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


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.
onlyleif
 
Posts: 0
Joined: Mon Dec 03, 2007 9:23 pm

Who is online

Users browsing this forum: No registered users and 3 guests