Anyone know why this small chunk of code is putting unwanted apostrophes in my cell functions? It's causing them to error out... Once I manually remove the marks, it calculates properly...
Here's what it's doing:
=COUNTIF(A:A, A5)>1 looks like this instead: =COUNTIF(A:A, ‘A5’)>1
=G5 looks like this instead: =’G5’
=I5 looks like this instead: =’I5’
=SUM('Z5'+'AA5')/730
Here's what it's doing:
=COUNTIF(A:A, A5)>1 looks like this instead: =COUNTIF(A:A, ‘A5’)>1
=G5 looks like this instead: =’G5’
=I5 looks like this instead: =’I5’
=SUM('Z5'+'AA5')/730
Code:
' DRAG FORMULAS FROM X TO Z DOWN TO BOTTOM
Range("X5").Select
ActiveCell.FormulaR1C1 = "=MID(RC[-23],5,9)"
'THE ABOVE ACTUAL CELL FORMULA IS: =MID(A5,5,9)
Range("Y5").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(A:A, A5)>1"
'THE ABOVE ACTUAL CELL FORMULA IS: =COUNTIF(A:A, A5)>1
Range("Z5").Select
ActiveCell.FormulaR1C1 = "=G5"
'THE ABOVE ACTUAL CELL FORMULA IS: =G5
Range("AA5").Select
ActiveCell.FormulaR1C1 = "=I5"
'THE ABOVE ACTUAL CELL FORMULA IS: =I5
Range("AB5").Select
ActiveCell.FormulaR1C1 = "=SUM(Z5+AA5)/730"
'THE ABOVE ACTUAL CELL FORMULA IS: =SUM(Z5+AA5)/730
Range("AC5").Select
ActiveCell.FormulaR1C1 = "=A5"
'THE ABOVE ACTUAL CELL FORMULA IS: =A5)
Range("X5:AC5").Select
Range("X5:AC5").AutoFill Destination:=Range("X5:AC" & Range("A" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault