karrotman
07-24-2012, 11:31 AM
Hi guys,
So I've been working on a simple linear interpolation code. Basically it takes a matrix of timedata and interpolates from the lowest time to the highest. Everything runs smoothly. What I would like is for my VBA code to spit out a matrix with the original values HIGHLIGHTED.
Keep in mind what my code does:
It accepts the input data
It creates a variant called MAT and fills it with dates and Xs for data
It interpolates and changes the Xs for the interpolated values
It sets the function (LinearInterpolation() ) to MATNow I would just use:CellName.Interior.ColorIndex = 4, but I know that will not work because at that point I am working on the virtual matrix MAT rather then the actual workbook. Does anybody have a solution for this? I know I can scan through the cells, but I want to keep this as dynamic as possible. In other words I want the function to do this without knowing where the interpolation is taking place.
This is what I have:
! https://www.quantnet.com/attachments/linearinterp-png.4161/
...and this is what I want:
https://www.quantnet.com/attachments/linearinterpwant-png.4162/
Thanks!
So I've been working on a simple linear interpolation code. Basically it takes a matrix of timedata and interpolates from the lowest time to the highest. Everything runs smoothly. What I would like is for my VBA code to spit out a matrix with the original values HIGHLIGHTED.
Keep in mind what my code does:
It accepts the input data
It creates a variant called MAT and fills it with dates and Xs for data
It interpolates and changes the Xs for the interpolated values
It sets the function (LinearInterpolation() ) to MATNow I would just use:CellName.Interior.ColorIndex = 4, but I know that will not work because at that point I am working on the virtual matrix MAT rather then the actual workbook. Does anybody have a solution for this? I know I can scan through the cells, but I want to keep this as dynamic as possible. In other words I want the function to do this without knowing where the interpolation is taking place.
This is what I have:
! https://www.quantnet.com/attachments/linearinterp-png.4161/
...and this is what I want:
https://www.quantnet.com/attachments/linearinterpwant-png.4162/
Thanks!