+ Reply to Thread
Results 1 to 4 of 4

Macro to count items and create summary

  1. #1
    Registered User
    Join Date
    04-15-2015
    Location
    Cincinnati, OH
    MS-Off Ver
    Microsoft Office ProPlus
    Posts
    14

    Macro to count items and create summary

    Hi all, I'm new to this forum and haven't been able to find an answer to my question. I'm currently working with a an excel file that looks something like this:

    Column A Column B
    1Review Question 1-10 Essay
    1Review Question 1-11 Essay
    1Review Question 1-12 Essay
    2Exercise 01-01A Matching
    2Exercise 01-02A FITB
    4Exercise 01-01B FITB
    4Exercise 01-02B Matching
    3Exercise 01-01B FITB
    3Exercise 01-02B Matching
    1Exercise 02-01A FITB
    1Exercise 02-02A FITB
    1Exercise 02-03A FITB

    I have to filter these spreadsheets to get counts for each of the different "types" in Column B and then keep a record of that count somewhere else. I'm wondering if a macro might allow me to 1) count the occurrences of a value in column B and 2) create a summary of the values and the counts. Something like this:

    Essay 3
    Matching 3
    FITB 6

    This is just a portion of the spreadsheet and the spreadsheets can vary greatly in terms of the number of items listed. Ideally, I'd like the macro to create a new worksheet called "Summary" and list all of the item types and counts there. Also, the items listed above in Column B are only a sampling of the available values - providing a list of what might occur in that column, wouldn't really work.

    Any ideas? I'm stumped - but I know there has to be a more efficient way to do this than how I'm currently doing it.

    Thanks in advance for your help!!

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Macro to count items and create summary

    this seems to be working:

    Please Login or Register  to view this content.
    as attached.

    also note - you can only run this once - if you need something that can be run multiple times without duplicating counts on each value i'd suggest adding a clearcontents line immediately after setting output = summary.

    ***second edit***
    i just added that line... it probably should be there, delete it if you don't want it for some reason.
    Attached Files Attached Files
    Last edited by simarui; 04-15-2015 at 10:19 AM. Reason: adding attachment and added clear contents line
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  3. #3
    Registered User
    Join Date
    04-15-2015
    Location
    Cincinnati, OH
    MS-Off Ver
    Microsoft Office ProPlus
    Posts
    14

    Re: Macro to count items and create summary

    I think this is working. Thanks so much!!

  4. #4
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Macro to count items and create summary

    glad i could help, don't forget to mark the post as solved

+ 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. Macro count items in sheet2 and provide count in embedded label in sheet1
    By jaredmccullough in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-05-2015, 11:27 AM
  2. Use individual to create summary table (only count clients once) vlookup?
    By Marvin85 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2015, 02:13 PM
  3. Count of unique items after Autofilter to another summary sheet
    By Kiran2012 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2014, 07:21 AM
  4. Replies: 1
    Last Post: 05-14-2012, 05:11 AM
  5. Need to count items and display summary
    By sharke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2008, 01:08 PM

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