Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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