+ Reply to Thread
Results 1 to 4 of 4

Consolidate, filter and copy data to another worksheet

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Salem, OR
    MS-Off Ver
    Excel 2007
    Posts
    2

    Consolidate, filter and copy data to another worksheet

    Hello,

    I have some workbooks with customer data. Their names can appear anywhere from three to four times with different monetary amounts per row. I need to add up the amounts per customer, filter out customers under a certain amount, and copy all the customer data, along with totals, to another worksheet. I would like to be able to do this with a function or macro so that it can be applied to different workbooks. My Excel coding skills are very week so hopefully someone here can help. Any help would be appreciated.

    Thanks,

    Rob
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Consolidate, filter and copy data to another worksheet

    Give this a go...
    Please Login or Register  to view this content.

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Consolidate, filter and copy data to another worksheet

    Just a quick note.. when using
    Please Login or Register  to view this content.
    Only 'c' is being declared as a Range variable, while 'r' is declared as a Variant. (Usually not a huge deal since memory usage isn't really an issue for modern PC's, just proper variable technique in VBA.)
    Please Login or Register  to view this content.
    Additional info regarding variables: http://www.cpearson.com/excel/DeclaringVariables.aspx

  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    Salem, OR
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Consolidate, filter and copy data to another worksheet

    Thanks for the help. With a little modification I got this code to work as I needed it to:

    Please Login or Register  to view this content.

    The only thing I have left is to filter out the data where the amount is < 3000. I did this with an advanced filter but was wondering if there was a way to do this in the function.

    I am also wondering if this line of code takes into account for duplicate names for different people:

    Please Login or Register  to view this content.

    i.e. if there are multiple John Smiths at different addresses.

    Again, thanks for the help. It is greatly appricated.

    Rob
    Last edited by Dunagh; 07-08-2010 at 10:47 PM.

+ Reply to Thread

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