Using Array To Identify Next Cells In Excel Through VB6

Qpido

New Member
Joined
Oct 9, 2007
Messages
30
Dear Members,

I am ever so close to finishing my calculation project.

This is the current interface I'm using (not working - see code)
http://img339.imageshack.us/f/screenapi.png/
The screen I get when I execute my program without the listed code.
http://img859.imageshack.us/f/screenexport.png/

What I ideally want is that my x just adds D6 to my range so I can use it in calculation.
Then the L goes to the next one and the calculation just happens like that on the next array.

I've tried to figure it out, but I am missing some steps.

Take a look:
Code:
        'References
Dim dia As Double
dia = Val(frmAutoCalc.txtDiameter.Text)
oXLSheet.range("A6:A109").Value = dia
Dim dens As Double
dens = Val(frmAutoCalc.txtDens.Text)
Dim price As Double
price = Val(frmAutoCalc.txtPrice.Text)
Const PI = 3.14159265358979
        'Weight Array Formula
Dim R As Excel.range
Dim volume As Double
Dim x As String
Dim l As Double
Dim lb As Double
Dim lArrayW(6 To 109) As Long
For l = 6 To 109
x = "D" & l
R = oXLSheet.range(x)
lb = Val(R)
volume = ((lb + 3) / 10) * PI * (((d / 10) / 2) ^ 2)
lArrayW(l) = dens * volume * 100
oXLSheet.range("D6:D109").Value = oXLApp.WorksheetFunction.Transpose(lArrayW)
Next l

Do I need an array in an array? And how do I make it so that the L will be counted up together with the D for the range column?

Thanks for your help,

Jerome
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top