[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

count number of "used" rows trick with vba - can't remember

Posted on 2012-03-13
2
Medium Priority
?
542 Views
Last Modified: 2012-06-21
what is the vba code that actual goes to the bottom of the workbook and works its way back up to count the number of used rows.  for instance you have a value in a1 and a5 and the code will return a count of 5 by going to the bottom and then working its way back up.
0
Comment
Question by:BigWill5112
2 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 2000 total points
ID: 37716734
activesheet.range("A" & activesheet.rows.count).end(xlup).row


xlup is -4162 if calling from VBS rather than excel VBA

Chris
0
 

Author Closing Comment

by:BigWill5112
ID: 37717020
Perfect
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question