Solved

# VBA - Loop through cells and multiply based on certain cells

Posted on 2016-10-21

Need VBA to do the below calculations. The range however can be 100s of columns and 100s of row.

So, I need to be able to loop through.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

(A$1*A3) (B$1*B3) (C$1*C3) etc.

I found the below code; however, I don't know what to do to get it to loop through the ranges and apply the formula based on row and column.

Sub LoopRange()

Dim rCell As Range

Dim rRng As Range

ActiveSheet.Range("C16:C25").Select

For Each rCell In Selection

If Not IsError(rCell) Then rCell = rCell * "don't now what to do here"

Next rCell

End Sub