Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can Excel tell me how many rows are populated via a functions?
Hello All,
I wrote an application that takes a data set and uploads it to an Oracle database. I'm cheating a little right now by using a hard coded number of rows to parse and upload from a spread sheet to the database. I'm wondering if there is a function that I can use in the VBA code that will give me the number of rows that are populated so I can have my parser run dynamically versus having to use the hard coded number of rows. Many thanks, Josh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can Excel tell me how many rows are populated via a functions?
Josh,
ActiveSheet.UsedRange.Rows.Count will return the number of rows used on the worksheet. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Josh" wrote in message ... Hello All, I wrote an application that takes a data set and uploads it to an Oracle database. I'm cheating a little right now by using a hard coded number of rows to parse and upload from a spread sheet to the database. I'm wondering if there is a function that I can use in the VBA code that will give me the number of rows that are populated so I can have my parser run dynamically versus having to use the hard coded number of rows. Many thanks, Josh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can Excel tell me how many rows are populated via a functions?
Josh
To select the used range...... Sub select_range() Dim someCells As Range With ActiveSheet.UsedRange Range("A1").Select Set someCells = ActiveSheet.Range(ActiveCell, _ .Cells(.Cells.Count)) End With someCells.Select End Sub To return the last row number........... Sub FindLastRow() Dim LastRow As Long If WorksheetFunction.CountA(Cells) 0 Then 'Search for any entry, by searching backwards by Rows. LastRow = Cells.Find(What:="*", After:=[A1], _ SearchOrder:=xlByRows, _ searchdirection:=xlPrevious).Row MsgBox LastRow End If End Sub Gord Dibben Excel MVP On Tue, 30 Nov 2004 13:36:14 -0800, "Josh" wrote: Hello All, I wrote an application that takes a data set and uploads it to an Oracle database. I'm cheating a little right now by using a hard coded number of rows to parse and upload from a spread sheet to the database. I'm wondering if there is a function that I can use in the VBA code that will give me the number of rows that are populated so I can have my parser run dynamically versus having to use the hard coded number of rows. Many thanks, Josh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Want only rows with populated data | Excel Worksheet Functions | |||
VBA to merge worksheets (only populated rows) | Excel Discussion (Misc queries) | |||
Need help linking spreadsheets and displaying only populated rows | Excel Discussion (Misc queries) | |||
Automatically gray out rows when a particular field is populated | Excel Discussion (Misc queries) | |||
how to count populated rows? | New Users to Excel |