ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count used cells, in a specific range... (https://www.excelbanter.com/excel-programming/295769-count-used-cells-specific-range.html)

Steff_DK[_4_]

Count used cells, in a specific range...
 
I want to count the number of cells in the range 'case' that contain
numbers... (or contains anything for that matter...)


This one gives 'error 6 overflow' maybe because it counts all cells i
the range.

iTest = Workbooks("Projekt
Function").Worksheets("data").Range("case").Count

Thanks

Stef

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


Frank Kabel

Count used cells, in a specific range...
 
Hi
try something like the following:
sub foo()
dim ret_value
dim rng as range
set rng = Workbooks("Projekt TFunction").Worksheets
("data").Range("case")
ret_value = application.worksheetfunction.COUNTA(rng)
msgbox ret_value
end sub

-----Original Message-----
I want to count the number of cells in the range 'case'

that contains
numbers... (or contains anything for that matter...)


This one gives 'error 6 overflow' maybe because it counts

all cells in
the range.

iTest = Workbooks("Projekt T
Function").Worksheets("data").Range("case").Cou nt

Thanks

Steff


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

.


Steff_DK[_5_]

Count used cells, in a specific range...
 
It works!

Thanks!!!

Stef

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


Paul

Count used cells, in a specific range...
 
Hi,

try this

Sub Test()
dim Rng as range
dim CellCount as long

set Rng = Workbooks("Projekt
TFunction").Worksheets("data").Range("case")
CellCount = Application.Worksheetfunction.COUNTA(Rng)

....
End Sub


Regards

Paul


"Steff_DK " wrote in message
...
I want to count the number of cells in the range 'case' that contains
numbers... (or contains anything for that matter...)


This one gives 'error 6 overflow' maybe because it counts all cells in
the range.

iTest = Workbooks("Projekt T
Function").Worksheets("data").Range("case").Count

Thanks

Steff


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





All times are GMT +1. The time now is 05:53 PM.

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