+ Reply to Thread
Results 1 to 6 of 6

VBA Program to sum values in one column if another column holds a particular value...HELP

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    VBA Program to sum values in one column if another column holds a particular value...HELP

    I am trying to use the SUMIF statement to add one column if another column has a specific part number...the issue is that I cannot use SUMIF directly as there are random gaps in the columns.

    For example:

    Column 1:
    Quantity
    3
    6
    2

    4
    2
    1

    Column 2:
    Part Number:
    884
    124
    884

    124
    884
    124



    The spreadsheet needs to be able to add the total number of parts produced and output that number in another cell.
    Last edited by soupra591; 03-05-2014 at 10:45 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    Why can't you use SUMIF again?
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    SUMIF doesnot work in this case because of the break between 884 and 124

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    SUMIF will ignore blanks. Can you upload example excel workbook?
    Make sure to avoid all private informations.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    Would something like this be of use?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    Sure, attached is a file that has the example.



    Quote Originally Posted by zbor View Post
    SUMIF will ignore blanks. Can you upload example excel workbook?
    Make sure to avoid all private informations.

  7. #7
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    Sure, attached is a file that has the example.

    Attachment 302076

    Quote Originally Posted by zbor View Post
    SUMIF will ignore blanks. Can you upload example excel workbook?
    Make sure to avoid all private informations.

  8. #8
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    Attachment 302078Sure, attached is a file that has the example.

    Attachment 302076

    Quote Originally Posted by zbor View Post
    SUMIF will ignore blanks. Can you upload example excel workbook?
    Make sure to avoid all private informations.

  9. #9
    Registered User
    Join Date
    02-10-2014
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: VBA Program to sum values in one column if another column holds a particular value...H

    It needs to be automated, so I can't have any user inputs...this output data will go into a montly workbook after the part number quantity is calculated


    Quote Originally Posted by JOHN H. DAVIS View Post
    Would something like this be of use?

    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 12-30-2013, 08:15 AM
  2. [SOLVED] VBA. Change interior colour between column A to column O as per values in column E
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2012, 05:42 AM
  3. How to Compare Column 12 to values in column 6 while deleting dups from column 12
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 12-16-2011, 03:21 AM
  4. Macro that will copy values in Column J and paste values to Column B in new sheet
    By Phixtit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2010, 04:56 PM
  5. Replies: 3
    Last Post: 01-10-2006, 06:10 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