Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to address elements in variant array?

And I'd use lbound, too:

For I = lbound(ary,1) To UBound(ary, 1)
For J = lbound(ary,2) To UBound(ary, 2)

Why remember if/when the array is 0-based or 1-based or something else based.

David wrote:

Dim rng As Range
Dim ary As Variant
Set rng = Range("A1:C10")
ary = rng.Value

How to loop through array and read/modify/delete elements

I've tried variations on the code below, but no joy so far...

For i = 1 to ubound (ary(1))
For j = 1 to Ubound(ary(2))
msgbox ary(i,j)
next
next


--

Dave Peterson
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
Eliminate Variant Array Elements David Excel Programming 2 August 8th 08 07:59 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
ReDim Object array as parameter of Variant array Peter T Excel Programming 4 May 10th 05 02:11 PM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 10:36 AM.

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"