View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Help with Excel VBA

You don't need VBA. You can use the SUMIF function. E.g.,

In C1, enter

=SUMIF($G$1:$G$30,B1,$H$1:$H$30)

and fill down to C8.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Tue, 25 Aug 2009 13:59:02 -0700, Howard
wrote:


-- I have a spread sheet as follows:
In Column B1 thru B8, I have listed names of workers. In Column C1 thru C8
are cells to hold total hours work. In Column G1 thru G30 are the workers
names listed again, (not in any order, and usually more than once), and to
the right in Column H1 thru H30 are the hours worked on a single job.

I need a way to look at the name in B1, search through column G1:G30 until a
name match is found, look to the right in Column H and find the hours worked,
add them to a variable, then continue on down the list in column G for the
next match, and add those hours to the variable. When finished with G1:G30,
the total hours in the variable will be transferred to cell C1 next to the
name, and the variable reset to zero.

Then we would go down to the name in B2, and start over until finished with
all the names in column B1:B8

I know this is long, but if someone can at least help me get started I would
really appreciate the help. Select Case won't work for what I need.