Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default General question on multidimensional variables

I have the following situation:

300+ forecasts
Each forecast is built from one of ~4100 candidate structured formula
Each candidate structured formula has 34 items of data


Any variable that I set up that is 300 x 4100 x 34 runs out of memory.

I've tried creating 34 variables each that are 300 x 4100 but that seem very inefficient.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default General question on multidimensional variables

wrote:
Any variable that I set up that is 300 x 4100 x 34
runs out of memory.


I had no problem executing the following macro:


Sub doit()
Dim v(1 To 300, 1 To 4100, 1 To 34) As Long
Dim n As Long, st As Double
st = Timer
For i = 1 To 300: For j = 1 To 4100: For k = 1 To 34
n = n + 1
v(i, j, k) = i * 1000000 + j * 100 + k
Next k, j, i
MsgBox n & " " & Format(Timer - st, "0.000 sec")
End Sub


The array v consumes 167,280,000 bytes. Task Manager showed that the peak
usage was about 186,968,064 bytes. Note the peak usage for Excel (new
workbook) and VBA (trivial macro) is about 19,402,752. So the numbers are
about right.

The run time was about 10.5 seconds.

Of course, that is for my version of Excel (2003) on my computer. YMMV.


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
General Question Ken Excel Discussion (Misc queries) 0 May 1st 08 05:48 PM
general question about variables integreat Excel Discussion (Misc queries) 2 May 20th 06 07:29 AM
General Question Me Excel Discussion (Misc queries) 3 January 12th 06 12:55 PM
General question David Excel Programming 1 February 4th 04 10:01 AM
General Question Squid[_2_] Excel Programming 3 January 12th 04 07:25 PM


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