yabby24
Chemical
- Nov 2, 2015
- 10
I am trying to use Access VBA code to interpolate (linearly) and return values to a table. I am still very new to both Access and VBA coding, so please be kind and clear any responses--I appreciate it!
Going off of this formula: y2 = [(x2-x1)(y3-y1)/(x3-x1)] +y1
My x2 column is in a table called "Calculation Sheet", while my x1, x3, y1, and y3 values are in a table called "Lookup Table" (x1,x3 in the same column in increments of 50, y1 and y3 in another column). I am trying to get the Access VBA program to find the y2 value from interpolation "Lookup Table" and return the value back to "Calculation Sheet" in another column for y2, which corresponds to x2 values.
I am at a loss for how to execute something like this and what the best way would be (sub vs function, SQL vs VBA code, etc). Any assistance appreciated, thank you!
Going off of this formula: y2 = [(x2-x1)(y3-y1)/(x3-x1)] +y1
My x2 column is in a table called "Calculation Sheet", while my x1, x3, y1, and y3 values are in a table called "Lookup Table" (x1,x3 in the same column in increments of 50, y1 and y3 in another column). I am trying to get the Access VBA program to find the y2 value from interpolation "Lookup Table" and return the value back to "Calculation Sheet" in another column for y2, which corresponds to x2 values.
I am at a loss for how to execute something like this and what the best way would be (sub vs function, SQL vs VBA code, etc). Any assistance appreciated, thank you!