how to sum numeric values of column (variable length) in 1st available blank cell

  • Thread starter Thread starter grimjim
  • Start date Start date
G

grimjim

Hi,

I have an invoice summariser xl document which takes the contents of
folder (ie. a quarter) and summaries the invoice contained in. As th
quarters can have variable numbers of invoices, I'd like to add
function which looks for the ist blank row in a given column (or an
column with numeric values if thats easier) and then totals it.
should imagine that this would be fairly easy, and a common requiremen
but I have been unable to find the appropriate code.

If anyone can help me out this would be much apprecciated.

Thanks in advance


And
 
Andy

To get the blank cell at the bottom of your data, have a look at this

http://www.dicks-blog.com/excel/2004/06/getnextcell.html

Then to sum that column, you can do"

Dim Rng as Rng

Set Rng = GetNextCell(1,Sheet1,False)

MsgBox Application.Sum(Sheet1.Cells(1,Rng.Column),Rng)

If all the cells are blank below your data, you could just sum the whole
column

MsgBox Application.Sum(Sheet1.Columns(1).Value)
 

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