lookup/total

B

Byers

I have a list of employees and they all work for differen
companies. In column D is there company and in column E is the cost t
employ them. I'm looking to create a way to find and total each of th
companies separately. I did this for a previous thing, but I knew tha
there were 12 things to find so I had it use lookup and just add eac
one, that was a huge pain in the ass.
I was thinking about using a while loop and keep a running total
trying to create a function that is TotalSubs("SubName"). The functio
will take the name, find it in column D and then add the correspondin
value in column E. Once it hits the bottom of the range, it stop
totaling. some suggestions would be a really big help as to some o
the code. I'm getting pretty good with visual basic, so just a roug
outline or explanation will be a huge help.

Thanks

-Byer
 
R

Rollin_Again

If you already have a list of the companies that are found in your dat
range you can use the SUMIF function to easily accomplish what you wan
without using VBA.


Rolli
 
D

Dave Peterson

You could try Data|Pivottables
or...
sort your data, select it and do Data|subtotals.
 
Top