ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculating Cell Range in a Column (https://www.excelbanter.com/excel-programming/292992-calculating-cell-range-column.html)

geoff

Calculating Cell Range in a Column
 
I am using a form to enter values into cells in a column. The number o
cells varies each time the template is used.

I need to select the range of cells, calculate the total and read tha
total into another cell.

I know how to select a fixed range but the problem I have is how t
select the range when the number of cells varies.

Hope this makes sense. Can anyone help?

Geof

--
Message posted from http://www.ExcelForum.com


mudraker[_161_]

Calculating Cell Range in a Column
 
geoff


to find last used cell in column A

looks from buttom row of spread sheet, finding first cell with an entr
iun column a

R = Cells(Rows.Count, "a").End(xlUp).Row
Range("a1:a" & R).Select

or

looks from first row of spreadsheet, finding 1st blanl cell in colum
a

R = Cells(1, "a").End(xlDown).Row
Range("a1:a" & R).Selec

--
Message posted from http://www.ExcelForum.com


Gord Dibben

Calculating Cell Range in a Column
 
Geoff

Sub selectrange1()
'from activecell in any column to bottom of used range in column including
blanks
Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select
End Sub


Sub SelectDown()
'to first blank row in active column
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub

Gord Dibben Excel MVP

On Sun, 29 Feb 2004 16:46:16 -0600, geoff
wrote:

I am using a form to enter values into cells in a column. The number of
cells varies each time the template is used.

I need to select the range of cells, calculate the total and read that
total into another cell.

I know how to select a fixed range but the problem I have is how to
select the range when the number of cells varies.

Hope this makes sense. Can anyone help?

Geoff


---
Message posted from http://www.ExcelForum.com/




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

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