lookup/total

  • Thread starter Thread starter Byers
  • Start date Start date
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
 
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
 
You could try Data|Pivottables
or...
sort your data, select it and do Data|subtotals.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top