Schaut so aus, als ob die Prozentwerte in Zeile 3 stehen?
Dann so:
For i = 5 To lastRow
If ws.Cells(i, "F").Value = "X" Then
ws.Cells(i, "F").Value = WorksheetFunction.Round(ws.Cells(i, "AH").Value * ws.Cells(3, "F").Value, 0)
End If
If ws.Cells(i, "G").Value = "X" Then
ws.Cells(i, "G").Value = WorksheetFunction.Round(ws.Cells(i, "AH").Value * ws.Cells(3, "G").Value, 0)
End If
If ws.Cells(i, "H").Value = "X" Then
ws.Cells(i, "H").Value = WorksheetFunction.Round(ws.Cells(i, "AH").Value * ws.Cells(3, "H").Value, 0)
End If
Next
Grüße
|