Ps. You have a couple of other things wrong with your formula.
If you need to have double quotes show up in your formula, then you'll need to
double them in your code.
And you don't need =sum(). You're just dividing one number by another.
And it looks like you're putting this all on Working Sheet, if that's true, then
you could try this:
Dim last7 As Long
With Worksheets("working sheet")
last7 = .Cells(.Rows.Count, "J").End(xlUp).Row
.Range("K1:K" & last7).FormulaR1C1 _
= "=IF(RC[1]/MACRO!r11c7,"""",RC[1]/MACRO!r11c7)"
End With
I'm not sure what you're doing with that formula, but maybe you were checking
for errors???
= "=IF(iserror(RC[1]/MACRO!r11c7),"""",RC[1]/MACRO!r11c7)"
is how I'd check.
S Himmelrich wrote:
>
> I'm getting an "Application-defined or object-defined error" on the
> line below that I've identified...can anyone help me out on this?
>
> Dim last7 As Long
> last7 = Worksheets("Working Sheet").Cells(Rows.Count,
> "J").End(xlUp).Row
> Range("K1").Formula = "=IF(SUM('Working Sheet'!RC[1]/MACRO!G
> $11$)),"",SUM('Working Sheet'!RC[1]/MACRO!G$11$)" <---LINE WITH ERROR
> Range("K1").AutoFill Destination:=Range("K1:K" & last7)
--
Dave Peterson
|