Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to count number of items(cells) in range?

Hi,
In a function I receive the range of cells as type range, now before using
it I want to count the number of cells in the range. please indicate how I do
this since I am unable to find a solution.
Kind regards

George
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default How to count number of items(cells) in range?

Hi George,

Range("A1:A25").cells.count

or

dim r as range
r = ...some range operation
debug.print r.cells.count

HTH,
Bernd

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to count number of items(cells) in range?

Thak you
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default How to count number of items(cells) in range?

Better, if you receive the range as an argument (which you should):

a.Cells.Count (if a was the range)

Never access worksheet cells directly in a function, always supply them as
an argument

--
Kind regards,

Niek Otten

wrote in message
oups.com...
Hi George,

Range("A1:A25").cells.count

or

dim r as range
r = ...some range operation
debug.print r.cells.count

HTH,
Bernd



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to count number of items(cells) in range?

Appreciated.

George
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 a number in a range with cells containing more than one numb Vermont Pete C Excel Worksheet Functions 12 June 24th 09 09:52 PM
Count the number of cells containing a date within a range Scoffers Excel Discussion (Misc queries) 5 February 24th 09 10:00 AM
Count cells in column that contain number in a range az willie Excel Worksheet Functions 9 December 12th 08 07:35 PM
count number of cells in range showing between 320 and 345 annieandtika Excel Worksheet Functions 6 June 25th 06 02:43 AM
Count number of cells in a range with amount 0 mikeburg[_6_] Excel Programming 7 July 14th 05 12:01 AM


All times are GMT +1. The time now is 05:52 AM.

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"