Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default LOOPING THROUGH A 2-D STRING ARRAY !!!

Hello !

I have a 2D string array, MyArray(110, 140). How do I loop through ONLY
the 2nd dimension (the 141 columns) referring to ALL the 111 rows in
EACH column as a SINGLE 1D array of (111 by 1) ?

Any help will be appreciated.

Thanks
Jay Dean


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default LOOPING THROUGH A 2-D STRING ARRAY !!!


for i = lbound(MyArray,1) to ubound(MyArray,1)
for j = lbound(MyArray,2) to ubound(MyArray,2)
MyChar = MyArray(i,j)
next j
next i
next i


It may be better to use a single dimension array with each items in the
array is a string and usew the MID function to get each character

Dim MyArray(110) as String

for i = lbound(MyArray,1) to ubound(MyArray,1)
for j = 1 to len(MyArray(i))
Mychar = Mid(MyArray(i),1)
next j
next i

"jay dean" wrote:

Hello !

I have a 2D string array, MyArray(110, 140). How do I loop through ONLY
the 2nd dimension (the 141 columns) referring to ALL the 111 rows in
EACH column as a SINGLE 1D array of (111 by 1) ?

Any help will be appreciated.

Thanks
Jay Dean


*** Sent via Developersdex http://www.developersdex.com ***

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
Problems Loading Large String Array into Array variable ExcelMonkey Excel Programming 6 May 6th 09 11:12 PM
Looping through each element of an array Conan Kelly Excel Programming 3 March 3rd 06 10:30 AM
Looping and String Variable Mourinho Excel Programming 4 October 28th 04 10:02 PM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
building a text string while looping though a worksheet Phillips Excel Programming 4 December 10th 03 08:31 AM


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