Hi,

So, I am trying to create a functino that first are doing a math expression, which is really simple, like:

Dim Answer as double
Answer = Worksheets("Sheet1").Range("D38").value - Worksheets("Sheet1").Range("D39").value
And after this I want the Value in "Answer" to look up a row with over 1000 values and find the nearest value and return the cell value in the column in front at the same row.

E.G:
Answer = 12.333444
the table has the values:

12.333500
12.333400

I then want the function to find the cell that has the corresponding value to 12.333400 (because that is the closest value) and return the value of the cell in front of that.
E.G:

Cell "C455" has the value, then the function must return the value in cell "B455".

Can anyone help me with that? I only know how to write this Vlookup formulas directly in the cell, but now I want to do it improved

I can make an excel sheet if necessary.