mattreingold
05-29-2018, 07:55 AM
What I am trying to do is simple - I know that. I cannot figure out for the life of me why I am getting a subscript out of range error... At this stage I am simply trying to load a constant value (AreaReal) to an array (areaArr). I want every element in the array to be this constant value so I can then take the 'loadArr' and divide it by 'areaArr' in a looping manner. I have searched and searched and either diving 'loadArr' by 'AreaReal' or this approach im taking now to divide each arrays element by eachother would work... Any direction would be much much appreciated!!
Dim loadArr()
Dim areaArr()
Dim stressArr()
loadArr = WSR.Range("AY267:AY" & TotalRows).Value
maxVal = WorksheetFunction.Max(loadArr())
Area = WSR.[AQ267].Value
AreaReal = 1000000 * Area
For q = LBound(loadArr) To UBound(loadArr)
areaArr(q) = AreaReal
Next q
For v = LBound(loadArr) To UBound(loadArr)
stressArr(v) = loadArr(v, 1) / areaArr(q)
Next v
Dim loadArr()
Dim areaArr()
Dim stressArr()
loadArr = WSR.Range("AY267:AY" & TotalRows).Value
maxVal = WorksheetFunction.Max(loadArr())
Area = WSR.[AQ267].Value
AreaReal = 1000000 * Area
For q = LBound(loadArr) To UBound(loadArr)
areaArr(q) = AreaReal
Next q
For v = LBound(loadArr) To UBound(loadArr)
stressArr(v) = loadArr(v, 1) / areaArr(q)
Next v