Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

To divide value in each cell to the sum of the corresponding columns.

$
0
0
Hi! I am a beginner to VBA, and would really appreaciate help.

I need to divide value in each cell to the sum of the corresponding column, and there are several columns.
Vakye in each cell in column K should be divided to the sum of column K, and the resutls will be written in in other sheet's column. And this operation is to be done to columns from K to V.
I found how to calculate sum for the K:V columns, but do not know how now to divide each cell values to the sum of the column. My script now looks like this, which does not work:


For iCol = 11 To 22 'Columns K:V

iSummory = .SUM(Range(Cells(2, iCol), Cells(LastRow, iCol)))

For Each C In Range(Cells(2, iCol), Cells(LastRow, iCol))
Worksheets("Sheet1").Cells(2, 1) = C / iSummory
Next C

Next iCol


Thank you!

Viewing all articles
Browse latest Browse all 50061

Trending Articles