I have one line of code that is returning a Compile error - "Expected: end of statement". The line of code is:

.FormulaR1C1 = "=IF(R[-1]C[1]" > "0,COUNTIF(R" & x & "C[-2]:R[1]C[-2],"" <= ""&R[-2]C[1]),IF(R[-1]C[1]" = "0,COUNTIF(R" & x & "C[-2]:R[1]C[-2],""<=""&R[-2]C[1])+1))".

To put it into context, I have attached my (horribly sloppy) code down below... the same screenshot of what the sheet looks like that I posted yesterday is:

https://docs.google.com/file/d/0B_sH...it?usp=sharing. I have no idea why I'm receiving the compile error.

Sub Analysis()

Dim r As Long

ActiveCell.Offset(-5, 1).Select

ActiveCell.Value = "Total Sales"

ActiveCell.Offset(0, 1).Select

ActiveCell.FormulaR1C1 = "=OFFSET(R[9]C[-6],-4,0,1,1)"

ActiveCell.Offset(1, -1).Select

ActiveCell.Value = "% Threshold"

ActiveCell.Offset(0, 1).Select

ActiveCell.Value = Range("BK4")

ActiveCell.Offset(0, 1).Select

ActiveCell.Value = ActiveCell.Offset(0, -1) * ActiveCell.Offset(-1, -1)

ActiveCell.Offset(1, -2).Select

ActiveCell.Value = "Exact?"

ActiveCell.Offset(0, 1).Select

ActiveCell.FormulaR1C1 = "=IF(RC[1]>0,""YES"",""NO"")"

ActiveCell.Offset(0, 1).Select

With ActiveCell

r = .Offset(2, -3).End(xlUp).Row

.FormulaR1C1 = "=COUNTIF(R" & r & "C[-3]:R[2]C[-3],""=""&R[-1]C)"

End With

ActiveCell.Offset(1, -2).Select

ActiveCell.Value = "# Of Styles"

ActiveCell.Offset(0, 1).Select

With ActiveCell

x = .Offset(1, -2).End(xlUp).Row

.FormulaR1C1 = "=IF(R[-1]C[1]" > "0,COUNTIF(R" & x & "C[-2]:R[1]C[-2],"" <= ""&R[-2]C[1]),IF(R[-1]C[1]" = "0,COUNTIF(R" & x & "C[-2]:R[1]C[-2],""<=""&R[-2]C[1])+1))"

End With

End Sub