PDA

View Full Version : Number of row with entries



N3K
08-04-2006, 01:16 AM
May i know how to count the number of rows with entries(n) only, please?

for example,

1
2
3
4
5

n = 5.

i need the value of n so that i can put into another function.
Can anyone help me with this? : pray2:

CCkfm2000
08-04-2006, 01:55 AM
try this =COUNTA(A1:A20) if your values are staring in cell a1 if not just change the A1:A20.

N3K
08-23-2006, 11:43 PM
can someone write a sample code which can work for me? i need to find the number of row with entries(n) and use that value n in another array in my program.

mdmackillop
08-24-2006, 12:00 AM
Sub Listing()
Dim Items As Long
Items = Application.WorksheetFunction.Count(Columns(1))
DoSomethingWithItems Items
Items = Application.WorksheetFunction.Max(Columns(1))
DoSomethingElseWithItems Items
End Sub

Sub DoSomethingWithItems(Items As Long)
MsgBox "Count is " & Items
End Sub

Sub DoSomethingElseWithItems(Items As Long)
MsgBox "Highest used item number is " & Items
End Sub

Zack Barresse
08-24-2006, 08:29 AM
What array? What program? You haven't posted your code!!! Please post all of your code, a zipped sample workbook (trimmed down for security and/or board uploading), an explanation on your desired final output and anything you've tried or haven't tried.