ElGrande
09-18-2017, 05:56 AM
Hi
I'm trying to take a value from a cell give it to a variable and match it against different condisions and when it match give a value to a different variable and put it in a other cell.
Anyone got some idea's?
Function ElseIf_dn()
'Select Sheet1
Sheets("Blad1").Select
Range("G2").Select
kv10 = Cells(7, 2).Value
If kv10 <= "0,6" Then dn10 = 15
ElseIf kv10 <= "4,0" Then dn10 = 22
ElseIf kv10 <= "10,0" Then dn10 = 28
ElseIf kv10 <= "30,0" Then dn10 = 35
ElseIf kv10 <= "65,0" Then dn10 = 42
ElseIf kv10 <= "130,0" Then dn10 = 54
End If
Cells(9, 2).Value = dn10
End Function
I'm trying to take a value from a cell give it to a variable and match it against different condisions and when it match give a value to a different variable and put it in a other cell.
Anyone got some idea's?
Function ElseIf_dn()
'Select Sheet1
Sheets("Blad1").Select
Range("G2").Select
kv10 = Cells(7, 2).Value
If kv10 <= "0,6" Then dn10 = 15
ElseIf kv10 <= "4,0" Then dn10 = 22
ElseIf kv10 <= "10,0" Then dn10 = 28
ElseIf kv10 <= "30,0" Then dn10 = 35
ElseIf kv10 <= "65,0" Then dn10 = 42
ElseIf kv10 <= "130,0" Then dn10 = 54
End If
Cells(9, 2).Value = dn10
End Function