Results 1 to 5 of 5

Excel VBA to count and print the occurance of a value from a range of cells

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-05-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2016
    Posts
    110

    Excel VBA to count and print the occurance of a value from a range of cells

    Dear all,

    I would like to have Excel VBA code to count and print the occurance of a value from a range of cells.

    Ex: Sheet " Input " has the following data:

    No. Name
    1 Albert
    1 Albert
    2 Boris
    2 Boris
    2 Boris
    3 Chris



    I would like the output as follows in the sheet "Output" :

    No. Count
    1 2
    2 3
    3 1

    Looks simple but not sure if it's efficient to loop through all values and have a counter variable to store the count or if a built-in function can do this?

    I would love to know the VBA code to do this.

    Many thanks in advance.

    Regards,
    Vinod Krishna
    Last edited by Vinod Krishna.C; 07-19-2013 at 02:14 AM.

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