Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Export 1-dimensional array values to a two-dimensional table? | Excel Programming | |||
Changing a two-dimensional, one row array to one-dimensional | Excel Programming | |||
Returning an array from a multi-dimensional array | Excel Programming | |||
Mutli-dimensional Array to Single-Dimension Array | Excel Programming | |||
Create One-Dimensional Array from Two-Dimensional Array | Excel Programming |