Home

run time error: Can anyone see the problem with this?

Highlighted
Frequent Contributor

Can anyone see the problem with this?

 

Sub Enter_Formulas()

For r = 30 To 33
Range("$U" & r).Formula = "=SUM($Y$17-$Y$18)/($Q & r))"
Next r

End Sub

 Not sure why I get run time error

1 Reply
Highlighted

Hi!

Try it with that:

Range("$U" & r).Formula = "=SUM($Y$17-$Y$18)/($Q” & r &”))"

 

Some letters are missing in your posted VBA Code, like one more & und one ".  Should work now.

Hope that helps. Greets, Eva.