I am using this "for each" statement to calculate a value in a new column. It works on some test data that I created in a new sheet but does not work in the intended application. I am pulling data from the first and fourth rows back from column O and multiplying them and then dividing the product by 100. This calculation should populate column O with data if there are values in the pull columns.
Dim Rng As Range
Dim c As Range
Set Rng = Range("O2:O" & Range("A65536").End(xlUp).Row)
For Each c In Rng
c.Value = c.Offset(0, -1).Value * c.Offset(0, -4).Value / 100
Next c
the formatting did not hold due to the window size but you can get the idea of the formula. Any ideas as to why this does not work?
Dim Rng As Range
Dim c As Range
Set Rng = Range("O2:O" & Range("A65536").End(xlUp).Row)
For Each c In Rng
c.Value = c.Offset(0, -1).Value * c.Offset(0, -4).Value / 100
Next c
the formatting did not hold due to the window size but you can get the idea of the formula. Any ideas as to why this does not work?