View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default auto sum macro if data is present above the cell

Do you want a function that you can put in the now-blank cell that sums from
the row above up to the previous blank row? Or do you want a SUB that just
puts the totals in the cells?

If the latter, how are you going to distinguish a total from an employee time?
If there were 2 blank rows between sets of data at the start, and you ran the
macro once, it would fill in one of the blanks. Then if you were to run it
again, it would fill in the final blank with a total that includes the
previous total. Not good.

Can you do what you are after with the built-in SubTotals feature? What does
your layout look like? Do you have the employee name in one of the columns and
the location in another, with both of those items always filled in (i.e. not
left blank because they are the same as in the row above)?


On Wed, 20 Oct 2004 14:13:34 -0500, onesaint
wrote:


Hey all,

i have a weekly work sheet that i do were i have to sum employees times
(9.78) at certian places they work. all the times are in the "L" column.
but there is diffrent amount of spaces between a group of times and
sometimes only 1 time for the job. i need a macro to search the column
for numbers and auto sum them. so something like...

7.48
6.48
4.35
18.23 <--- sum

4.35
4.35 <---sum

and so on. thank you for any help in advance.