+ Reply to Thread
Results 1 to 4 of 4

How to select filtered values and copy the results using makros

  1. #1
    Registered User
    Join Date
    10-06-2015
    Location
    Kleve
    MS-Off Ver
    2010
    Posts
    5

    How to select filtered values and copy the results using makros

    Hello everyone,
    two weeks ago I had my first try in this forum and it worked out really well. I hope that I'll improve my thread style this time
    and maybe get another good result

    The Problem: I got a table1 with Names (PersonCode) in column A. These persons have been asked what they've eaten today (energy, protein, carbohydrates). Some of them had 2,3 or 4 meals a day. I want to get their daily intake and therefor add the different meals for each person. The result should be as in table2: The name of the person in column A and the sum of all Energy intake of that day in Column C. (and so on).
    This an example workbook. the real one has 2700 persons and 20 values to sum up.

    Mappe1.xlsm

    Is there any way of calculating this automatically ? I was thinking about choosing one personcode via autofilter, than calculating the sum of VISABLE results e.g. in column B, C, ... . And then choosing the next personCode in the autofilter automatically.

    I'd be really grateful for any kind of help,
    many thanks in advance,
    Malte

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: How to select filtered values and copy the results using makros

    Hello Malte
    This isn't a macro solution but take a look at the attached reply, it might help. Your main database I've converted to an Excel Table to make it dynamic. On the second sheet is an example of Sumifs referencing Table1 and a Pivot Table sourced once again from Table1. Do these summarize the data as required? The Pivot will have to be refreshed after adding new data to Table1 in order to update its calculations.

    Hope this helps.
    DBY
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,985

    Re: How to select filtered values and copy the results using makros

    You should only need the SUMIF calc though?

    ie in C2 put:
    Please Login or Register  to view this content.
    Then drag across and down as necessary.
    If someone has helped you then please add to their Reputation

  4. #4
    Registered User
    Join Date
    10-06-2015
    Location
    Kleve
    MS-Off Ver
    2010
    Posts
    5

    Re: How to select filtered values and copy the results using makros

    Thanks a lot DBY, it worked perfectly fine. A new tool in excel that I haven't used before. My plan was way to complicated :D

    I will try your way as well, pjwhitfield, just to learn the function. thank you!

+ 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. [SOLVED] VBA: Select filtered rows then copy all but header row
    By chellisage in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2014, 03:35 PM
  2. Select and copy n number of rows from Filtered Table
    By Swindo in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-24-2013, 09:30 PM
  3. [SOLVED] Using a button to select Non-Zero values from a list and paste the results to a textbox
    By Thy_Raven13 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-10-2013, 07:44 AM
  4. [SOLVED] Using SUMPRODUCT and SUBTOTAL to count filtered results containing #N/A values
    By Powerslave in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-17-2013, 12:07 PM
  5. Copy only filtered results of advanced filter
    By csh8428 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2013, 04:51 PM
  6. Replies: 1
    Last Post: 04-08-2012, 04:59 AM
  7. Replies: 1
    Last Post: 08-09-2010, 05:38 AM
  8. Using VBA to autofilter and paste over results - can't select only filtered rows.
    By Cornwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2010, 11:33 AM

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