Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Count used cells, in a specific range...

It works!

Thanks!!!

Stef

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count cells in range w/specific background color? Michael[_3_] Excel Worksheet Functions 3 November 8th 08 05:51 AM
Count percentage of specific text in a range of cells kruggie2000 Excel Worksheet Functions 1 October 6th 08 05:59 PM
How to count specific letters in range of cells? Renee R.[_2_] Excel Discussion (Misc queries) 3 June 22nd 07 08:14 PM
count specific text that occurs in a range of cells Tim Excel Discussion (Misc queries) 16 October 10th 06 01:41 AM
formula to count cells containing #'s in a specific range woogiebooboo Excel Worksheet Functions 1 April 27th 06 08:23 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"