I have a pretty long macro and it is working fine at my work computer. The problem is that it is not working on my home computer. The macros are stored in personal xlsm file at roaming. So I just copy paste the personal file to my computer and run the macro. Everything is perfect until it needs to take a data from sheet2 to sheet1, in same excel workbook. It gives runtime 1004 object defined error. Any thoughts?
Range("R2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]<= " & MeanCov1 & ",-AVERAGE(Sheet2!R[3]C[-13]:R[3]C[12]),IF(RC[-2]<= " & MeanCov2 & ",-AVERAGE(Sheet2!R[3]C[-13]:R[3]C[" & WeekCov11 & "]),IF(RC[-2]<= " & MeanCov3 & ",-AVERAGE(Sheet2!R[3]C[-13]:R[3]C[" & WeekCov22 & "]),-AVERAGE(Sheet2!R[3]C[-13]:R[3]C[" & WeekCov33 & "]))))"
Range("R2").Select