I'm sure there are many ways to do this and the way I'm doing it is probably the least efficient but anyways I'm getting an error with this. I want to insert an averaging formula into 1200 rows of a sheet that does not include rows with no entries. Here's my code.
For i = 2 To 1201
P_Sht.Cells(i, 2).Formula = "=if(count(C " & i & ":DD " & i & ")>0,Average(C " & i & ":DD " & i & "),"")"
'Error Here
Next i
Is there an easier way of doing this with say R1C1 or something by just being able to paste a range? I want to take the average of C through DD for all these rows.....
Thanks for any help. Have a nice day.
-Rob
Bookmarks