I am trying to do a vba code for excel where I can retrieve the comparison operator(e.g. <, <= etc.) from the excel sheet. What I am trying to do give a score based on the value and the bands being key in.
I wanted to do something like this in the code:
Sample data:
cell A1 = 80(input)
cell A4 = "<"
cell B4 = 75
cell C4 = "="
cell D4 = 75
cell E4 = ">"
cell F4 = 75
Example of the code I wanted to do:
dim score as integer
dim result as integer
score = range("A1").value
methodoperatorb1 = range("A4").value
methodoperatorb2 = range("C4").value
methodoperatorb3 = range("E4").value
band1 = range("B4").value
band2 = range("D4").value
band3 = range("F4").value
if score (methodoperator1)(band1) then result = 1
elseif score (methodoperator2)(band2) then result = 2
else result = 3
Sorry for the bad example and really hope someone can help me with this problem.