counting data....urgent help required please!!

sach_k

New Member
Joined
Jul 4, 2008
Messages
38
i have a long list of names on an excel sheet and i am using this macro to count the number of times each inputed name occurs. the names of engineers are entered into a inputbox on a loop
how do i put the names of ALL the engineers and ALL the results (counted number if occurrences) into cells?? is there a simple macro that will read the list of names that is being by itself??

Count = 0
Target = InputBox("engineer(s) to find?")
If Target = "" Then GoTo Done
For Each Cell In Selection
N = InStr(1, Cell.Value, Target)
While N <> 0
Count = Count + 1
N = InStr(N + 1, Cell.Value, Target)


Wend
Next Cell
MsgBox Count & " Occurrences of " & Target
Done:
Loop Until Target = "end"

i really need this as soon as possible, my work cannot move forward until this is done. thanks!!!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Why not just use Data>Pivot table...?
 
Upvote 0
Can't you use an Advanced Filter - to get the unique names and then use
COUNTIF. So COUNTIF(A:A,"Smith") would give you the number of SMITH's in Column A.

Kaps
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top