How to find out how many rows do my collumn have?

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

Hi!

I have to find out how many rows do my collumn have.
Can enyone give me som VB solution?

I tried:
Range.Rows.Count byt then I obtain 65K
and
Range.Parent.UsedRange

any others propositions??

Thanx in advice Leon!
 
Hi Leon,

I don't know how to do it with VBA but you can do it by a cell in excel and you will put in your program
dim nbrofrow as integer
Range("a1").select
activecell.formulaR1C1="=count(B:B)" 'or countif(C:C,1,B:B)....
nbrofrow = range("a1").value
I hope this will help you...
Merry christmas
Benjamin
 
With Activesheet.usedrange
msgbox .Rows.count
End With

for a specific column

set rng = Range(cells(1,"C"),cells(rows.count,"C").End(xlup))
msgbox rng.rows.count
 
Sub countrows()
MsgBox Cells(Rows.Count, "c").End(xlUp).Row
'or
'MsgBox Cells(Rows.Count, activecell.column).End(xlUp).Row
End Sub
 
U¿ytkownik "Leon said:
Hi!

I have to find out how many rows do my collumn have.
Can enyone give me som VB solution?

I tried:
Range.Rows.Count byt then I obtain 65K
and
Range.Parent.UsedRange

any others propositions??

Thanx in advice Leon!

Thanx both of you!!

Leon!
 
Back
Top