Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have selected a column and called it "Mark" I need to determine the number
of rows in this column with values in them at runtime. The number of rows used in this column will vary. How do I determine the number of rows with values? If I use Range("Mark").Rows.Count it appears to return a very large number. thank you mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This would get you the count all filled cells in the range application.countA(Range("mark")) This would get you the count all NUMERIC cells in the range application.count(Range("mark")) Notes: VBA Range("mark") is unqualified, thus works on the activeworkbook only. VBA application.countA is preferred notation for application.worksheetfunction.countA (you dont get intellisense, but you dont get runtime errors either) NAME object when you use names be aware of the differences in using "local" and "global" names. If your sheet may be copied by users IMO it's better to use "local" names only. You'll define "local" names by adding the sheet's name and an exclamation mark to them in the define name dialog. e.g. Sheet1!mark -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam John Smith wrote in message : I have selected a column and called it "Mark" I need to determine the number of rows in this column with values in them at runtime. The number of rows used in this column will vary. How do I determine the number of rows with values? If I use Range("Mark").Rows.Count it appears to return a very large number. thank you mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you
mark "keepITcool" wrote in message ... This would get you the count all filled cells in the range application.countA(Range("mark")) This would get you the count all NUMERIC cells in the range application.count(Range("mark")) Notes: VBA Range("mark") is unqualified, thus works on the activeworkbook only. VBA application.countA is preferred notation for application.worksheetfunction.countA (you dont get intellisense, but you dont get runtime errors either) NAME object when you use names be aware of the differences in using "local" and "global" names. If your sheet may be copied by users IMO it's better to use "local" names only. You'll define "local" names by adding the sheet's name and an exclamation mark to them in the define name dialog. e.g. Sheet1!mark -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam John Smith wrote in message : I have selected a column and called it "Mark" I need to determine the number of rows in this column with values in them at runtime. The number of rows used in this column will vary. How do I determine the number of rows with values? If I use Range("Mark").Rows.Count it appears to return a very large number. thank you mark |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See response to original question.
-- HTH RP (remove nothere from the email address if mailing direct) "John Smith" wrote in message ... I have selected a column and called it "Mark" I need to determine the number of rows in this column with values in them at runtime. The number of rows used in this column will vary. How do I determine the number of rows with values? If I use Range("Mark").Rows.Count it appears to return a very large number. thank you mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Not listing more than a range of rows | Excel Worksheet Functions | |||
formula to sort a range so that it matches the exact rows of a column that is outside that range? | Excel Discussion (Misc queries) | |||
group rows in a range based on criteria from another range (vba) | Excel Programming | |||
How to subtract some rows from a range | Excel Programming |