C
cqmman
Hello,
Another simple problem I hope!
I have a list of rows (lets say 80), and I want column R to contain
the answer from the number in cell "l", divided from the number in
"'d" for each of the 80 columns. The values in columns L and D are
both numbers.
Based on a previously helpful bit of code, I thought I could do this:
Set col1 = Sheets("Historical").Columns("d")
Set col2 = Sheets("Historical").Columns("l")
For Each c In Range("r1:r80") 'unique list in sh1
c.Value = col2.Value / col1.Value
Next c
I have tried playing around and using things like:
c.value = col2 / col1
Or even this:
DivideBy(col2,col1)
Function DivideBy(ByVal Numerator As Double, ByVal Denominator As
Double) As Double
DivideBy = Numerator / Denominator
End Function
But still can't quite get it right. What am I doing wrong?
Cheers
Another simple problem I hope!
I have a list of rows (lets say 80), and I want column R to contain
the answer from the number in cell "l", divided from the number in
"'d" for each of the 80 columns. The values in columns L and D are
both numbers.
Based on a previously helpful bit of code, I thought I could do this:
Set col1 = Sheets("Historical").Columns("d")
Set col2 = Sheets("Historical").Columns("l")
For Each c In Range("r1:r80") 'unique list in sh1
c.Value = col2.Value / col1.Value
Next c
I have tried playing around and using things like:
c.value = col2 / col1
Or even this:
DivideBy(col2,col1)
Function DivideBy(ByVal Numerator As Double, ByVal Denominator As
Double) As Double
DivideBy = Numerator / Denominator
End Function
But still can't quite get it right. What am I doing wrong?
Cheers