Solved

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

Posted on 2012-03-13
2
534 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

929 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now