+ Reply to Thread
Results 1 to 2 of 2

Loop autofilter thru all variables, calculate and paste

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    Canberra Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    Loop autofilter thru all variables, calculate and paste

    I have 4 cols C, V, S, N. Each column has two values, 1 or 2. The combination of those 4 column values makes 16 distinct records i.e. 1-1-1-1, 1-1-1-2, 1-1-2-1....2-2-2-2. Each record has a 5th value on the end, a "W" or "L", making 32 combinations. The list of data is added to each day. As required I need a vba code to trigger the auto filter to find all records for each combination and pair the "W" &"L" records side by side. i.e. say 1-1-2-2-W alongside 1-1-2-2-L. It then performs 3 calculations on the two subsets, and the data dragged with it from the data sheet, namely "P" and "$".

    Once the 3 calculations are performed it will paste these to a new worksheet, then loop back to find the next consecutive combination, calculate, paste after the last paste and repeat till the cycle is complete. As the data is added to each day it will include the range extension each time it is run. The real life scenario for this comprises 8 variables for each column (1...8) and the number of rows is in the 200,000 plus category. That makes for 8000plus combinations if you include the "W" & "L" variants. You might like to incorporate the 1 thru 8 variables per column in your code or just use the 1 thru 2 as per the attached example, and I'll modify.

    Cheers for reading this post.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Loop autofilter thru all variables, calculate and paste

    Cross posted here: http://www.ozgrid.com/forum/showthread.php?t=195736
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Calculate, Copy/Paste Loop using VBA
    By datakat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2013, 10:14 AM
  2. Replies: 1
    Last Post: 03-13-2013, 02:27 PM
  3. Loop to check 2 variables then copy/paste entire row to new worksheet
    By patrick riley in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-02-2012, 02:10 PM
  4. Copy, paste, calculate and loop
    By williampdx in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-11-2012, 06:42 PM
  5. Macro for calculate, copy, paste loop
    By stevenf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2008, 12:05 PM

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