Hi i created a code in vba. the requirements is that
-input is 3 color bands from a resistor(in order)
-and the output of the resistor in ohms
-make function work for 3 colors.I am using vba. I came up with a code but it has my function highlighted in yellow. whats wrong with it?
'Resistor By: Diamond Wongus
Function Resistor(color1, color2, color3)
'I cannot put the equation until the end
Select Case color1
Case "black", "Black"
color1 = 0
Case "brown", "Brown"
color1 = 1
Case "Red", "red"
color1 = 2
Case "Orange", "orange"
color1 = 3
Case "Yellow", "yellow"
color1 = 4
Case "Green", "green"
color1 = 5
Case "Blue", "blue"
color1 = 6
Case "Violet", "violet", "Purple", "purple"
color1 = 7
Case "Grey", "grey", "Gray", "gray"
color1 = 8
Case "White", "white"
color1 = 9
Case "Gold", "gold"
color1 = 0.1
Case "Silver""silver"
color1 0.001
'the above information is for color 1
Select Case color2
Case "black", "Black"
color2 = 0
Case "brown", "Brown"
color2 = 1
Case "Red", "red"
color2 = 2
Case "Orange", "orange"
color2 = 3
Case "Yellow", "yellow"
color2 = 4
Case "Green", "green"
color2 = 5
Case "Blue", "blue"
color2 = 6
Case "Violet", "violet", "Purple", "purple"
color2 = 7
Case "Grey", "grey", "Gray", "gray"
color2 = 8
Case "White", "white"
color2 = 9
Case "Gold", "gold"
color2 = 0.1
Case "Silver""silver"
color2 0.001
'the above data is color 2
Select Case color3
Case "black", "Black"
color3 = 0
Case "brown", "Brown"
color3 = 1
Case "Red", "red"
color3 = 2
Case "Orange", "orange"
color3 = 3
Case "Yellow", "yellow"
color3 = 4
Case "Green", "green"
color3 = 5
Case "Blue", "blue"
color3 = 6
Case "Violet", "violet", "Purple", "purple"
color3 = 7
Case "Grey", "grey", "Gray", "gray"
color3 = 8
Case "White", "white"
color3 = 9
Case "Gold", "gold"
color1 = 0.1
Case "Silver""silver"
color3 0.001
'The above data is color 3
End Select
Resistor = (color1 * 10 + color2) * (10 ^ color3)
End Function