|
|
Excel funtion to find out how many rows are filled?
|
|
|
|
Mac Enthusiast
Join Date: Sep 2000
Location: New York, NY
Status:
Offline
|
|
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
|
|
Not an excel whiz but would
=if(A1="", 0, 1)
and then add up the results work?
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Sep 2000
Location: New York, NY
Status:
Offline
|
|
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
|
|
Me know no VBA. Me use simple functions.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Nov 2003
Location: Middle of the street
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|