ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I set the position to a specific cell location in excel (https://www.excelbanter.com/excel-programming/357345-how-do-i-set-position-specific-cell-location-excel.html)

lpdarspe

how do I set the position to a specific cell location in excel
 
I want to make a macro in excel that will go to the end of a data column and
do a summation of the data in the row immediately following the data.

Toppers

how do I set the position to a specific cell location in excel
 
lastrow = Cells(Rows.Count, "A").End(xlUp).Row ' will give last row in column A

Cells(lastrow + 1, "A") = Application.Sum(Range(Cells(2, "A"),
Cells(lastrow, "A")))


HTH

"lpdarspe" wrote:

I want to make a macro in excel that will go to the end of a data column and
do a summation of the data in the row immediately following the data.


Gary Keramidas

how do I set the position to a specific cell location in excel
 
and just to give another option, if you want a formula instead of the value for
the total, you could use this

Range("A" & Lastrow + 1).Formula = "=sum(A2:A" & Lastrow & ")"



--


Gary


"lpdarspe" wrote in message
...
I want to make a macro in excel that will go to the end of a data column and
do a summation of the data in the row immediately following the data.




lpdarspe

how do I set the position to a specific cell location in excel
 
Thank you very much. It fit the requirements exactly!

"Gary Keramidas" wrote:

and just to give another option, if you want a formula instead of the value for
the total, you could use this

Range("A" & Lastrow + 1).Formula = "=sum(A2:A" & Lastrow & ")"



--


Gary


"lpdarspe" wrote in message
...
I want to make a macro in excel that will go to the end of a data column and
do a summation of the data in the row immediately following the data.





lpdarspe

how do I set the position to a specific cell location in excel
 
Thanks! It fit my requirements exactly!!

"Toppers" wrote:

lastrow = Cells(Rows.Count, "A").End(xlUp).Row ' will give last row in column A

Cells(lastrow + 1, "A") = Application.Sum(Range(Cells(2, "A"),
Cells(lastrow, "A")))


HTH

"lpdarspe" wrote:

I want to make a macro in excel that will go to the end of a data column and
do a summation of the data in the row immediately following the data.



All times are GMT +1. The time now is 10:02 PM.

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