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: 586
Default Make an Array 2-dimensional in VBA

I fill an array with 4 celled ranges. The 4th cell in the Range is a price
of a part. I then use a For...Next Loop to sum those prices. I need the
array that I indicated with "" to be two dimensional (or
..aryPartDes(35)(1,4)) because I am getting a "Subscript out of Range" on the
line indicated "ERROR". I think because the current array is viewed like
this .aryPartDes(35)(4) thus it can,t find the price. Any ideas?

' NON MARKUP ITEMS

' onsite service techinician, do not mark up
If chkServicePlan Then
.aryPartDes(35) = Array("", "Ad Tech On Site Service Techinician", "ea.", CDbl(tbxOnSiteServiceTechCost))

.aryPartQty(35) = 1
Else
.aryPartDes(35) = ""
.aryPartQty(35) = 0
End If

' software, do mark up
.aryPartDes(36) = PartInfo("Software")
.aryPartQty(36) = 1

' freight charges for modules, do not mark up
.aryPartDes(37) = PartInfo("ModuleShipRate")
.aryPartQty(37) = .ModuleCount * Val(tbxQuantity)

' sum items not to be marked up
Total.NoMarkUpItems = 0
For i = 35 To UBound(aryPartQty)
If aryPartQty(i) 0 Then
ERROR Total.NoMarkUpItems = Total.NoMarkUpItems + .aryPartQty(i) *
..aryPartDes(i)(1, 4)
End If
Next i
--
Cheers,
Ryan
 
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
Export 1-dimensional array values to a two-dimensional table? Laurie Excel Programming 2 November 8th 07 03:51 PM
Changing a two-dimensional, one row array to one-dimensional Alan Beban[_2_] Excel Programming 1 September 16th 07 08:56 PM
Returning an array from a multi-dimensional array Chris Excel Programming 2 January 3rd 07 06:01 AM
Mutli-dimensional Array to Single-Dimension Array Blue Aardvark Excel Programming 3 October 15th 05 09:22 AM
Create One-Dimensional Array from Two-Dimensional Array Stratuser Excel Programming 1 February 23rd 05 08:46 PM


All times are GMT +1. The time now is 09:46 AM.

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"