• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Excel

How to determine the number of rows that the worksheet used?

i need to know it at runtime
what is the syntax ?

Thanks
0
garbage76
Asked:
garbage76
1 Solution
 
bruintjeCommented:
Hi garbage76,

this will display the used rows in the active sheet

sub uRowCount()

Dim xlApp as Object
Dim rowcount As integer

'create you excel object or use the current one

rowcount = Range("A1", Selection.SpecialCells(xlCellTypeLastCell)).Rows.Count

MsgBox " " & rowcount

'do your stuff

end sub

HTH
:O)Bruintje
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now