+ Reply to Thread
Results 1 to 6 of 6

Help with DSUM

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Help with DSUM

    Im new to Excel programming. please pardon the ignorance.

    i have two worksheets. worksheet "AA" is used to display totals with criteria from worksheet "BB" via one column. for example

    Column XX
    1
    2
    4
    3
    1
    2
    1
    1
    2

    the above is what data is within the column.

    On sheet "AA" i need to show the total of how many 1's, how many 2's etc. are within column XX on worksheet "BB".

    Can someone help to code this, if i get the code for "1" working i can get the rest to work. I was thinking a DSUM would fulfill this requirement. but i cannot figure out how to identify the other worksheet, and do no understand the [sum range] requirement.

    your expertise is greatly appriciated.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help with DSUM

    Not sure what you mean. Why o you need VBA for DSUM?

    n example workbook might help
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-05-2009
    Location
    texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Help with DSUM

    Did I post in the wrong forum?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help with DSUM

    I can't tell from your question what you want, you mention programming which is VBA, but have a problem with DSUM which is a Function.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Help with DSUM

    Hi Taylor, welcome to the forum.

    You shouldn't need DSUM or VBA. You can just use COUNTIF between the workbooks (the second worksheet, 'BB', doesn't even need to be open if you put the path in the formula). Example:

    Assuming:
    Book1.xlsx, Sheet1: Numbers 1 through 4 are in A1:A4
    Book2.xlsx, Sheet1: List of numbers is in column A

    In B1 of Book1.xlsx put the formula:

    =COUNTIF('C:\Excel_Files\[Book2.xlsx]Sheet1'!$A:$A,A1)

    Then copy that formula down to B4 and you should have your counts. Change the path to your actual path, of course!

  6. #6
    Registered User
    Join Date
    08-05-2009
    Location
    texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Help with DSUM

    Paul -

    thanks for the help. but i am only using one book with multiple sheets. does your solution still apply?

+ 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