Results 1 to 6 of 6

Comparing and Copying Values Between Dates

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-03-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    106

    Comparing and Copying Values Between Dates

    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!!
    Attached Files Attached Files
    Last edited by ExcelQuestFL; 02-21-2010 at 11:27 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1