+ Reply to Thread
Results 1 to 13 of 13

Sum cells based on values of another cell. Then paste that sum.

  1. #1
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Sum cells based on values of another cell. Then paste that sum.

    Hello,
    I have tried and tried to make a macro work for this and my macros have gotten pretty complex but nothing I do works. So now I am just lost and needing help. Any help would be greatly appreciated and thanks in advance. I need a macro to do what is explained below.

    I have attached the workbook. I use a workbook to fill out a daily report. On the “Report” Tab, I need my Hours (column D) summed based on the decimal number shown in the Codes (column C) and then that sum needs to be pasted-values in the “Imported” tab to the Hours (column H) in the row with the same code decimal number.

    Note: The codes I am showing are not the codes I will have on every job. I make these up as I go. So the macro cannot just be based on the decimal numbers I have shown in this workbook.

    I also need to do this for the Qty but I think I can figure out how to change the macro if someone can make it work for the hours.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    How do you identify the uniqueness of column C? is 619.1000 >< Moving >< 1 Ea equals to 619.1000?
    Or do you only take the string before <>?

  3. #3
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    Thank you so much for responding.

    The uniqueness is the number before the first “><” example: 619.1000. This number is also on sheet “Imported” That is where I need the sum to be placed; in column H and the row that has the same number. …I hope that helps.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    Try the attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    Wow!!! That is exactly what I needed. However, remember how I thought I could modify it to make it work for the Quantity? Well, I was wrong. Can you show me how to do that? Thank you.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    Add quantity:-
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    Give a guy an inch he'll take a mile. Ok, so this works great but I have one more request. Again I thought I could just modify what you gave me but the code is way over my head. Can you make this work for Columns A and B from the Report tab and paste the total in column C in the "Employee" and "Equipment" tabs?

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    Ohm?
    I do not know where this is going to end-up?
    Column A of sheet report does not have any duplicate, so you will have a single value for each value in column B of sheet employee. I am assuming you want to match column A of sheet report with column B of sheet employee and the same applies to sheet Equipment. Am I missing something? Better if you could show me the desired result.
    Last edited by AB33; 12-23-2013 at 06:36 PM.

  9. #9
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    I have re-uploaded the workbook, hope that helps. I made an "Hours" column in both the Employee and Equipment tabs. You are correct those lists will not have any duplicates and yes I want to match column A of sheet report with column B of sheet employee and the same applies to sheet Equipment. Again, thank you so much.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    I have rethought my last response and I was wrong. There will be duplicates in columns A and C of the sheet report. Is is possible, if duplicates, to have the pasted values start in column C and go to the next column over and paste the next value? I have again uploaded a new workbook to hopefully explain better.
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    You keep changing your request, so the attached is going to be the last one. No more adjustments.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Sum cells based on values of another cell. Then paste that sum.

    Thank you very much for doing this. You did exactly what I needed.

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum cells based on values of another cell. Then paste that sum.

    Thor55,
    You are welcome!

    Could you please now close (Mark) this thread as solved? Go to the top right-hand side of this page, choose "Thread Tools" from the menu, then select "solved" from the drop down menu.

+ 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] Macro - Copy and Combine values in cell and paste it in other cells based on Unique ID
    By haleakala17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2012, 05:41 PM
  2. Replies: 1
    Last Post: 10-14-2012, 09:25 AM
  3. Formula to copy and paste data in cells to other cells based on values
    By haleakala17 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-11-2012, 08:45 AM
  4. Copy and Paste values based on another cell
    By clc3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2012, 05:15 PM
  5. Copy Rows and Paste Based On Cell Values
    By boohah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2010, 08:58 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