Qpido 0 Newbie Poster

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:

'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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.