Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Counting the number of nonempty cells

I want to count the number of nonempty cells in column A. However, I do not
want to start with cell A1. I want to begin counting in cell A4. Then I
would llike to assign this value to a variable. Any help would be greatly
appreciated.

Thanks
sc


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Counting the number of nonempty cells

Hi SC,

Try:

Sub Tester()
Dim rng As Range
Dim iCtr As Long

Set rng = Range("A4:A" & Rows.Count)
i = Application.CountA(rng)
'Return count of populated cells
MsgBox iCtr

End Sub

---
Regards,
Norman



"Steve" wrote in message
...
I want to count the number of nonempty cells in column A. However, I do
not want to start with cell A1. I want to begin counting in cell A4. Then
I would llike to assign this value to a variable. Any help would be
greatly appreciated.

Thanks
sc



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
Counting number of cells Sabrina Excel Worksheet Functions 4 January 20th 10 06:12 AM
Counting number of cells that match name AND number Ronster[_2_] Excel Worksheet Functions 4 August 18th 08 12:03 PM
Counting the number of cells that have the same value JCM Excel Worksheet Functions 1 September 4th 07 02:24 AM
Counting the number of same value cells Richard Excel Discussion (Misc queries) 1 April 27th 07 11:37 PM
List the one nonempty cell Adam Graham Excel Discussion (Misc queries) 6 December 17th 06 06:19 PM


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

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

About Us

"It's about Microsoft Excel"