My VBA skills are quite lacking (hence my request), but the macro I think would be pretty easy to program. I've written out the approach below and as you'll see it's pretty doable (although not for the untrained like myself). I'd really appreciate any assistance with this please.
Essentially, I’m attempting to find values that are within a band of .001 of the values of cells in columns L through O and searching columns B through I for values that meet the .001 criteria and copying the values to columns Q, R, S, and T respectively.
I mentioned the values in L, M, N and O are where the comparisons will be made and these values are tagged to a specific date in Column K. I need to find the dates in Column A that are in between the values of K and the cell beneath it. For example, in K4 I have a date of 10/3/99 and the next date I have in K5 is 10/5/99. I would then query Column A for the dates 10/06/99 (A4), 10/07/99 (A5), and 10/08/99 (A6). The values I need to find within the .001 band are in Columns B through I (B4:I6). Lastly, when reach the last value in Column K, query all values in Column A greater than last value in K and copy the appropriate values in B through I to Q through T.
Rules for copying data to Column Q, R, S, and T:
For Column Q-
Find values in B, C, or D that’s within plus or minus .001 of M and copy the value of B, C, or D into Column Q of the same row.
For Column R-
Find values in B, C, D, or E that’s within plus or minus .001 of L and copy the value of B, C, D, or E into Column R of the same row.
For Column S-
Find values in G, H, or I that’s within plus or minus .001 of N and copy the value of G, H, or I into Column S of the same row.
For Column T-
Find values F, G, H, or I that’s within plus or minus .001 of O and copy the value of F, G, H, or I into Column T of the same row.
***I attached a sample and completed what the results would be for the first 3 values of K so you can see the logic. There should be only one value that’s copied into Q, R, S, or T. If the difference is exactly .001 the value should be copied.
Hope all is clear and if not feel free to ask any questions. Again, I appreciate any help on this!!![]()
Bookmarks