Consulting

Results 1 to 9 of 9

Thread: Pull data from overall sheet to new sheet based on criteria

  1. #1

    Pull data from overall sheet to new sheet based on criteria

    Hello, I need you help please on the attached sample file

    In sheet 1 a sample for daily data for all customers (original file contain data of last 5 years and rows over 30000 rows).
    On daily basis, I need to review the full transaction history for X customer statement and revise some entries if needed. (Revise the price / quantities, etc).
    In sheet 2, I want to have the following please:

    1. Cell B3, to create unique list for all customer (so I can choose the desired customer and show the report for him).
    2. Since the costumer has too many transactions , I wish to use Cells G2 & G3 to show the report within specific period of time ( from – to )
    3. Once the customer name selected in cell B3, the full transaction history must displayed in the below range A6:I6 until last row.
    4. In column No 10 (column J), I wish to have formula to calculate the total amount for the customer ( I mean to subtract the total IN from the Total OUT for each row and show the balance in this column , so I can tract down when was last time the balance for this customer was 0 $.
    5. the range of this rows preferable to be automatically adjusted for each print.
    6. hope to consider add or remove column in overall table will not affect sheet 2


    Hope this is clear and many thanks in advance for your help
    Attached Files Attached Files

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi edkawy79!
    Only 1 - 3 items are processed. You can choose the name in cell B3.
    Please refer to the attachment.
    Attached Files Attached Files

  3. #3
    Quote Originally Posted by 大灰狼1976 View Post
    Hi edkawy79!
    Only 1 - 3 items are processed. You can choose the name in cell B3.
    Please refer to the attachment.

    大灰狼1976
    Thanks a lot of your efforts and apologize for late reply, since I was testing th log

    About point no 2 ( date cells ) I see that first I must to choose the period of time that I wish to have the report otherwise the data will be all pulled out. Is it possible to revise this to update customer report automatically ??
    About point no 4 , this is very important need for my file , so I have put sample formula I am using in sheet 1, column K ( named Customer Total ) but it make my file very slow , is it possible to put this formula in VBA code so the file would be faster ?
    Finally , is it possible to keep original formulas in sheet 2 same as sheet 1 ?

    Many thanks again for your big help and I wish the above request will not bother you a lot.

    Overall_Draft (1).xlsm

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    Try changing your formula in cell K7 of the Sheet1 sheet from:
    =SUBTOTAL(9,$I$7:I7)-SUBTOTAL(9,$H$7:H7)
    to:
    =SUMIF($B$7:$B7,[@Customer],I$7:I7)-SUMIF($B$7:$B7,[@Customer],H$7:H7)
    so that your "so I can tract down when was last time the balance for this customer was 0 $." will work. Currently your subtotals formula only uses the visible cells and if the dates are filtered the sums only take into account those dates (they will exclude all prior data so will not show you when the balance was last $0).
    Note that for this type of formula (both yours and mine) to work, the data in column A MUST be sorted oldest to newest (oldest date at the top)
    The long time it's taking seems to be the filtering (and recalculation) of sheet1. I would use a pivot table instead with a timeline. It's much faster (no filtering of the original table at all). Out of time just now but if I get time I'll put a workbook together.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  5. #5
    p45cal ... thanks a lot for your efforts, i changed the formula as you said and its ture , sheet 1 is very slow due to recalculation and this is big problem for me... the original file about 30000 rows ..
    what about pivot table with timeline ... can you please show me example how it would work for me ??
    thanks agian

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    Quote Originally Posted by edkawy79 View Post
    what about pivot table with timeline ... can you please show me example how it would work for me ??
    Yes, but not right now.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    In the attached, on Sheet2b, select your customer in cell B3 or in the slicer at cell N1, play with the TimeLine at the top. Updates are almost instantaneous.
    Attached Files Attached Files
    Last edited by p45cal; 07-06-2019 at 01:26 PM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    @p45cal -- that's cool. I've never used Timeline before. Thanks for showing it
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  9. #9
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,873
    edkawy79 I noticed a PM from you earlier today, but now it seems to have disappeared. Could you try again to post here or send me another Private Message.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Tags for this Thread

Posting Permissions

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