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: 23
Default Can I have an array of arrays and access an element simply?

I have
Private aAllCMDRows(1 To MAX_CMD_ROWS) As clsCMDdefn6A
Private aAllMACRows(1 To MAX_WS_ROWS) As clsMACdefn6A
Private aAllWSRows (1 To MAX_OP_ROWS) As clsWSdefn6A
(and another two)
Can I put these in another array:
Private aAllArrays(1 To 5)
using
Const ID_CMD = 1
Const ID_MAC = 2
Const ID_WS = 3

aAllArrays(ID_CMD) = aAllCMDRows '
aAllArrays(ID_MAC) = aAllMACRows
aAllArrays(ID_WS) = aAllWSRows

I want to access them as follows:
Dim oCMD As clsCMDdefn6A
addToArray ID_CMD, oCMD

Sub addToArray( iID As Integer, _
vItem As Variant )
Dim vArray As Variant ' ref to array?
Set vArray = aAllArrays(iID) ' type mismatch
vArray(1) = vItem
End Sub

But got the runtime problem in line 2.

Thanks for your help,
Peter.

(It's for an Excel macro under XP)





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Simply Array Formula? Going Crazy with excel[_2_] Excel Discussion (Misc queries) 6 May 31st 10 07:03 PM
Counting Array element asingh Excel Worksheet Functions 4 April 12th 10 03:30 PM
Permutations of an array element < to a value Bruce Excel Worksheet Functions 3 January 31st 06 04:00 PM
Array element Andrea[_8_] Excel Programming 5 December 7th 04 08:24 PM
deleting array element michael Excel Programming 0 December 18th 03 08:55 PM


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