Hi,
I am trying to multiply some cells in VBA.
The problem is that I use a loop (until "iteration") and the number of cell where the multiplication should be done is unknown.
I have 5 columns and I want in in column 4 starting in E4 until "iteration#":
take the value from column 1 (same row) * H3 +
take the value from column 2 (same row) * H4 +
take the value from column 3 (same row) * H5 +
In column 5 beginning in F5 until "iteration#" I want
take the value from column 4 * M4 + M5* N5
\1
If it is not much more difficult I would actually prefer to have a code that takes H4-H6 and M4-M5 and N5 from a differen sheet.
I started off with something like this, but it wouldnt work:
I would appreciate any help asap!!Range(Cells(4, 5), Cells(Iterations + 3, 5)).Value = Range(Cells(Iterations + 3, 5), Cells(Iterations + 3, 5)).Offset(0, -3).Value * Range("H3").Value + Range(Cells(Iterations + 3, 5), Cells(Iterations + 3, 5)).Offset(0, -3).Value * Range("H4").Value + Range(Cells(Iterations + 3, 5), Cells(Iterations + 3, 5)).Offset(0, -3).Value * Range("H5").Value
Range(Cells(4, 6), Cells(Iterations + 3, 6)).Value = Range(Cells(Iterations + 3, 6), Cells(Iterations + 3, 6)).Offset(0, -1).Value * Range("M4").Value + Range("N5").Value * Range("M5").Value
Cheers
Bookmarks