Any suggestions of how to solve this problem?
(Updated)
numerator,denominator are ranges containing integer values.
I want to do a division cell by cell of these ranges, e.g:
numerator(1)/denominator(1) numerator(2)/denominator(2) ...
and paste the results in quotient. All ranges are of same size and are row-vector dimensioned.
My solution attempt:
Sub DivRanges()
Dim targetRng As Range, sourceRng1 As Range, sourceRng2 As Range
For i = 1 To targetRng.Cells.Count
quotient.Cells(i).Value = numerator.Cells(i).Value / denominator.Cells(i).Value
Next i
End Sub
The problem is that DivRanges doesn't loop through each value of the ranges since they are row-vectors. Instead it goes horisontally one step down as i grows. This problem occurs when the cells of the ranges are not adjacent.
Here's a display of the problem based on code from mehow . The result are the cells selected in the sheet.




