Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want only rows with populated data Pete[_7_] Excel Worksheet Functions 1 April 12th 11 04:21 PM
VBA to merge worksheets (only populated rows) akscooby Excel Discussion (Misc queries) 4 November 19th 09 10:19 AM
Need help linking spreadsheets and displaying only populated rows demarchi Excel Discussion (Misc queries) 1 November 26th 08 10:19 PM
Automatically gray out rows when a particular field is populated Bob Luck Excel Discussion (Misc queries) 4 August 30th 08 05:24 PM
how to count populated rows? Ryan Cain New Users to Excel 4 August 12th 05 04:35 AM


All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"