+ Reply to Thread
Results 1 to 4 of 4

If a cell contains a specific value, then certains cells require to be totaled

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Lightbulb If a cell contains a specific value, then certains cells require to be totaled

    Hi All,
    i have a quick question, (see attached file for how my database looks, its an excerpt from a large database)Book1.xls

    here is what i would like to happen.

    I want my Macro/VBA to search column B and C, if B and C match an entry in seperate "employee" database i am constructing then i wish for all data related to that individual in column E to be summed up and the total plugged into a seperate sheet.

    I am in newbie catagory so bear with me. I was going to do if and then statements over and over but then i researched creating a seperate worksheet with all the staff names instead of putting them in the code would save a lot of time.

    i guess my main concern is how do i write the following in code

    "if column b and c are both equal to column a and b in employees sheets then all instances of where B and C equal sheets data E must be summed and totalled."

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: If a cell contains a specific value, then certains cells require to be totaled

    Hi

    you dont have the 2nd sheet/table?

    Also, I think you can probably do this with a sumifS() function, instead of VBA
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: If a cell contains a specific value, then certains cells require to be totaled

    Hi FDibbins,
    i left out the second sheet as it contains a lot of data, i will ammend and change names on it later and upload it to see if it will help, it has to be done via vba as these call outs on the original file are recorded on an excel spreadsheet, then printed, then manually entered on another excel sheet in another dept which i want to stop.

    I simply want to find all call outs, regardless of call out type but kept under the same specialty and employee name and then auto populate a file that records all call outs completed by an individual employee on a monthly basis under their specialty.


    The file i wish to auto populate would have headings like this,

    Specialty, Surname, Name ,Total Calls.,

    thanks for your advice and input, i will update the file later.

    Dave

  4. #4
    Registered User
    Join Date
    08-03-2012
    Location
    Cork Ireland
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: If a cell contains a specific value, then certains cells require to be totaled

    Book1v2.xls

    Now here is my book done with a tiny data base of people on sheet 2.

    I have put in a tiny bit of code in via a macro to show what i want but its very basic and horrifically limited

    anyway my code will only sum up the call outs if the cells match.

    what i want to do is scan a selected row or cells (one person) on sheet 3 and go through all the data on sheet 1 and sum up all call outs per individual and add them together and display on sheet 3.

    here is my very bad code any way.

    all help appreciated.

    Please Login or Register  to view this content.
    Last edited by unreal_event_horizon; 03-12-2013 at 04:48 AM.

+ 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