ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   summing data in several columns (https://www.excelbanter.com/excel-discussion-misc-queries/89475-summing-data-several-columns.html)

david72

summing data in several columns
 

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/


--
david72
------------------------------------------------------------------------
david72's Profile: http://www.excelforum.com/member.php...fo&userid=7980
View this thread: http://www.excelforum.com/showthread...hreadid=543614


bgeier

summing data in several columns
 

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"?

david72 Wrote:
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/



--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=543614


david72

summing data in several columns
 

If column a and column b are the same. I would like to sum the total of
column c.

Thanks


--
david72
------------------------------------------------------------------------
david72's Profile: http://www.excelforum.com/member.php...fo&userid=7980
View this thread: http://www.excelforum.com/showthread...hreadid=543614


bgeier

summing data in several columns
 

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(intRowCoun ter, 1) = ThisWorkbook.Worksheets("Sheet1").Cells(intRowCoun ter, 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
--------------------


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=543614



All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com