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!
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!