+ Reply to Thread
Results 1 to 3 of 3

count values in a column and populate table

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    count values in a column and populate table

    Hello there VBA experts,

    I have a list of faults and each fault has a specific fault code e.g. Hardware failure = fault code 101

    There are only a set amount of fault codes in the data I extracted roughly around 10 different codes all listed in Column A with there corresponding data. What I would like to achieve is to populate a table on worksheet 2 listing the number of faults per fault code through a button e.g.

    Worksheet 1

    A1

    101 ....
    101
    101
    102
    101
    103
    104

    Worksheet 2

    Fault code N.o. of Occurences
    101 4
    102 1
    103 1
    104 1

    Total N.o of Faults 7

    That is my first mission, my second mission is I would like to use this data to create a graph based on monthly statistics of the number faults. As the number of faults in table is going to be used to create the graph when the above macro is updated these numbers are going to change. What im trying to get my head around is how am i going to specify the macro above to publish the next months data in the next column thus creating a new bar in my graph e.g.

    Fault code JAN - N.o. of Occurences FEB - N.o of Occurences
    101 4 8
    102 1 2
    103 1 1
    104 1 0



    Any tips or starting points with this VBA macro would be most welcomed !

    Thanks

    HB

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,858

    Re: count values in a column and populate table

    See attached.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: count values in a column and populate table

    Thanks alan ! that works perfectly , How would i incorporate this into a macro so i can run it through a button.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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