Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Excel funtion to find out how many rows are filled?

Excel funtion to find out how many rows are filled?
Thread Tools
JFischel
Mac Enthusiast
Join Date: Sep 2000
Location: New York, NY
Status: Offline
Reply With Quote
Nov 30, 2004, 05:38 PM
 
Hey all,

I'm writing some stuff in VBA to parse a spread sheet and load the parsed data into an Oracle Database. I'm cheating a little because I know exactly how many rows are being filled in. However, in the future I was hoping that the parser could run dynamically. Does anyone know if there's a function like maxrows() or something like that in VBA that will return the number of rows that have data?

Thanks

Josh
20 Inch Intel iMac * MacBook 2 GHz * 60GB iPod * 4GB iPhone
     
Ω
Mac Elite
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 1, 2004, 07:49 AM
 
Not an excel whiz but would

=if(A1="", 0, 1)

and then add up the results work?
     
JFischel  (op)
Mac Enthusiast
Join Date: Sep 2000
Location: New York, NY
Status: Offline
Reply With Quote
Dec 1, 2004, 01:17 PM
 
Actually, I was able to work it out...There's a function built into Excel. You have to use it something like this:

>ActiveSheet.UsedRange
>LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row

Thanks,

Josh
20 Inch Intel iMac * MacBook 2 GHz * 60GB iPod * 4GB iPhone
     
Ω
Mac Elite
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 1, 2004, 05:17 PM
 
Me know no VBA. Me use simple functions.

     
insha
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status: Offline
Reply With Quote
Dec 28, 2004, 10:16 AM
 
To get the number of rows that are being used:
getRowCount = ActiveSheet.UsedRange.Rows.Count

To get the number of columns that are being used:
getColCount = ActiveSheet.UsedRange.Columns.Count
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:04 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,