auto sum macro if data is present above the cell

  • Thread starter Thread starter onesaint
  • Start date Start date
O

onesaint

Hey all,

i have a weekly work sheet that i do were i have to sum employees time
(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 an
sometimes only 1 time for the job. i need a macro to search the colum
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
 
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)?
 

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

Back
Top