LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Identifying last filled area ('row') of an array via VBA?

I have a large variant array (1 to 50000, 1 to 50). I'd like to set a
variable equal to the number of 'rows' of data that are actually in the
array, so I can use that in other parts of my code. lbound/ubound seems to
return the whole array size regardless of how much of the array contains
data.

When checking for the last used row in a worksheet I use:

Function Find_Last(sht As Worksheet)
Find_Last = sht.Cells.Find(What:="*", After:=sht.Range("A1"),
LookAt:=xlPart, _
LookIn:=xlFormulas, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, MatchCase:=False).Row
End Function

Is there an equivalent for arrays (that avoids looping the entire array and
checking for blank values)?

Thanks!
Keith


 
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
Multi area Array using IRR function Malakite Excel Worksheet Functions 2 September 16th 09 01:32 PM
Assign a single variable to an Array filled with same data types RyanH Excel Programming 7 July 21st 08 09:05 PM
highest used area of an array ("uBound" of used area)? Ker_01 Excel Programming 1 February 15th 08 10:51 PM
Can a checkbox be placed 'within a row'? Dan R. Excel Programming 1 May 9th 07 09:03 PM
Keeping an Array Filled and running macro from other workbooks? NooK[_5_] Excel Programming 2 June 23rd 04 04:42 PM


All times are GMT +1. The time now is 05:50 PM.

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

About Us

"It's about Microsoft Excel"