+ Reply to Thread
Results 1 to 4 of 4

Thread: VBA to look at column A find a sheet and do a sum if from that shee

  1. #1
    Registered User
    Join Date
    11-25-2011
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    82

    VBA to look at column A find a sheet and do a sum if from that shee

    I need a macro that will look at summary sheet column A and find a coresponding sheet with the same date. Go to that sheet and sum column E if column C cell has 1 or 2 in it.

    Please see attached
    Thank you
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    686

    Re: VBA to look at column A find a sheet and do a sum if from that shee

    You can put this formula in B14 of your summary sheet:

    =SUMPRODUCT(--((INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!C2:C10")=1)+(INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!C2:C10")=2)),INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!E2:E10"))

    and then copy down. You might like to change the ranges C2:C10 (twice) and E2:E10 to suit the real extent of your data in those other sheets.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-25-2011
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: VBA to look at column A find a sheet and do a sum if from that shee

    Quote Originally Posted by Pete_UK View Post
    You can put this formula in B14 of your summary sheet:

    =SUMPRODUCT(--((INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!C2:C10")=1)+(INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!C2:C10")=2)),INDIRECT("'"&TEXT($A14,"mm-dd-yy")&"'!E2:E10"))

    and then copy down. You might like to change the ranges C2:C10 (twice) and E2:E10 to suit the real extent of your data in those other sheets.

    Hope this helps.

    Pete
    Thanks Pete but I really need the macro for this. Example provided is just a simple version of what needs to be cone

  4. #4
    Registered User
    Join Date
    11-25-2011
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: VBA to look at column A find a sheet and do a sum if from that shee

    Anyone any suggestions?

+ 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.2.0