Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default How to find out the size of a variable-size array ?

Hi,

Is there a function to find out the size of a variable size array ?
Thanks.

regards,
Adrian


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default How to find out the size of a variable-size array ?

UBound / LBound are what you're after.

If you want to know the number of dimensions: Check my website for "Number
of Dimensions"
(posted here for archive)

Sub test()
Dim arr(1, 2, 3, 4) As Long
Dim i As Long

On Error Resume Next
Do: i = i - (LBound(arr, i + 1) * 0 = 0): Loop Until Err.Number
On Error GoTo 0

MsgBox i
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Adrian" wrote in message
...
Hi,

Is there a function to find out the size of a variable size array ?
Thanks.

regards,
Adrian




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
Variable screen size, not resolution Molly Excel Worksheet Functions 4 June 7th 08 12:32 AM
Variable size of chart Derek Locke Charts and Charting in Excel 2 November 24th 07 11:44 AM
Populating a summary of variable size. shakey1181 Excel Discussion (Misc queries) 0 June 22nd 06 03:47 PM
Find size of array passed to user-defined function Cliff[_2_] Excel Programming 2 October 21st 03 02:09 AM
Array Size Srinath Excel Programming 4 August 15th 03 07:58 PM


All times are GMT +1. The time now is 02:07 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"