ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Summing a Column of Variable Length (https://www.excelbanter.com/excel-programming/386786-summing-column-variable-length.html)

Carlee

Summing a Column of Variable Length
 
Hello, me again,

Question: I would like to sum the values contained in Column D, on sheet
"Master", and place total in Column Z, on sheet "Monthly". Hitch: the
number in column D on sheet 'Master' is variable.

How can i accomplish this?
--
Carlee

Tom Ogilvy

Summing a Column of Variable Length
 
=sum(Master!D:D)

if you mean with a macro

tot = Application.Sum(Worksheets("Master").columns(4))

worksheets("Monthly").Cells(rows.count,"Z").End(xl up)(2) = Tot

--
Regards,
Tom Ogilvy

"Carlee" wrote:

Hello, me again,

Question: I would like to sum the values contained in Column D, on sheet
"Master", and place total in Column Z, on sheet "Monthly". Hitch: the
number in column D on sheet 'Master' is variable.

How can i accomplish this?
--
Carlee


Carlee

Summing a Column of Variable Length
 
Hi there,

This works well....how can i copy this function down to specified cells in
Column Z?
--
Carlee


"Tom Ogilvy" wrote:

=sum(Master!D:D)

if you mean with a macro

tot = Application.Sum(Worksheets("Master").columns(4))

worksheets("Monthly").Cells(rows.count,"Z").End(xl up)(2) = Tot

--
Regards,
Tom Ogilvy

"Carlee" wrote:

Hello, me again,

Question: I would like to sum the values contained in Column D, on sheet
"Master", and place total in Column Z, on sheet "Monthly". Hitch: the
number in column D on sheet 'Master' is variable.

How can i accomplish this?
--
Carlee


merjet

Summing a Column of Variable Length
 
Sub Sum1()
Dim iEnd As Integer
iEnd = Sheets("Master").Range("D1").End(xlDown).Row
Sheets("Monthly").Range("Z1").Formula = "=SUM(Master!D1:D" & iEnd &
")"
End Sub

Hth,
Merjet




All times are GMT +1. The time now is 12:04 AM.

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