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: 19
Default Populating a 2-D array

I have successfully used the Array statement to initialise a 1-dimensional
array, as follows:

NUMWORD = Array("One", "Two", "Three", "Four", "Five", "Six", "Seven", _
"Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", _
"Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen", "Twenty")

But I have been unable to apply the same technique to a 2-dimension array
(12 x 4), and am left having to enter 48 lines of repetive code - as
follows. Is there an easier way?

' FIRST PARAMETER IS FORMATTED WORD 1 - 12
' SECOND PARAMETER IS: length, colour, line, character

W(1, 1) = Len("FASTEST")
W(1, 2) = 1 ' BLACK
W(1, 3) = 5 ' line 5
W(1, 4) = 6 ' char 6
W(2, 1) = Len("CREATE")
W(2, 2) = 1 ' BLACK
W(2, 3) = 5 ' line 5
W(2, 4) = 25 ' char 25
W(3, 1) = Len("NINE")
W(3, 2) = 1 ' BLACK
W(3, 3) = 5 ' line 5
W(3, 4) = 43 ' char43
W(4, 1) = Len("ANSWERS")
W(4, 2) = 1 ' BLACK
W(4, 3) = 6 ' line 6
W(4, 4) = 10 ' char 10
W(5, 1) = Len("WRONG")
W(5, 2) = 3 ' RED
W(5, 3) = 6 ' line 6
W(5, 4) = 38 ' char 38
W(6, 1) = Len("CHAIN")
W(6, 2) = 1 ' BLACK
W(6, 3) = 7 ' line 7
W(6, 4) = 12 ' char 12
W(7, 1) = Len("THE")
W(7, 2) = 1 ' BLACK
W(7, 3) = 7 ' line 7
W(7, 4) = 32 ' char 32
W(8, 1) = Len("CHAIN")
W(8, 2) = 1 ' BLACK
W(8, 3) = 7 ' line 7
W(8, 4) = 50 ' char 50
W(9, 1) = Len("BANK")
W(9, 2) = 5 ' BLUE
W(9, 3) = 9 ' line 9
W(9, 4) = 18 ' char 18
W(10, 1) = L3 ' CONTESTANT GOING FIRST
W(10, 2) = 1 ' BLACK
W(10, 3) = 18 ' line 18
W(10, 4) = 31 ' char 31
W(11, 1) = Len("£20")
W(11, 2) = 1 ' BLACK
W(11, 3) = 21 ' line 21
W(11, 4) = 28 ' char 28
W(12, 1) = Len("CLOCK")
W(12, 2) = 1 ' BLACK
W(12, 3) = 23 ' line 23
W(12, 4) = 12 ' char 12




 
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
Populating an array Bucs85027 Excel Worksheet Functions 0 February 14th 08 12:32 AM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Populating another tab. Brian Excel Discussion (Misc queries) 1 June 24th 05 12:29 AM
Populating a Temporary Array Pete Excel Programming 6 January 14th 04 01:57 PM
populating multicolumn listbox with an array instead of... notsureofthatinfo Excel Programming 0 November 5th 03 10:18 PM


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