summing data in several columns

  • Thread starter Thread starter david72
  • Start date Start date
D

david72

Hi

I have several sheets that contain the following data: eg column a has
brk and column b has a town and column c has a value. Is there any way
I can sum the total for column a and column b in a another sheet

Thanks for any help/
 
How do you mean sum them in another sheet?
Do you want column "A" totaled and column "B" totaled or do you want
the total of column "A" PLUS total of Column "B"?
 
If column a and column b are the same. I would like to sum the total of
column c.

Thanks
 
I apologize, I missed the last clause of the first phrase in your post.
(I claim temporary stupidity)


Code:
--------------------
Sub TotalC()
Dim intRowCounter As Integer

intRowCounter = 1

Do Until Cells(intRowCounter, 1) = ""
If ThisWorkbook.Worksheets("Sheet1").Cells(intRowCounter, 1) = ThisWorkbook.Worksheets("Sheet1").Cells(intRowCounter, 2) Then _
ThisWorkbook.Worksheets("Sheet2").Cells(1, 1) = ThisWorkbook.Worksheets("Sheet2").Cells(1, 1) + ThisWorkbook.Worksheets("Sheet1").Cells(1, 3)
intRowCounter = intRowCounter + 1
Loop
End Sub
 

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