I have a table where in column CM I want to insert a formula in cell# CM3 and then copy that formula to all cells below until (and including) the last cell with data as per column A.
Here is my code:
Range("CM3").FormulaR1C1 = "=IF(AND(AY3=""yes"",BB3=""successful"",DZ3=""yes""),1,0)"
With Sheets("VoC Data Extract (2)")
.Range("CM3").AutoFill .Range("CM3:CM" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
When I run the macro all the cells return as #NAME ? because the formula the macro inserted look like this:
=IF(AND('AY3'="yes",'BB3'="successful",'DZ3'="yes"),1,0)
Apostrophes were added around the cells in the formula. How do I avoid this?
Thanks in advance
Here is my code:
Range("CM3").FormulaR1C1 = "=IF(AND(AY3=""yes"",BB3=""successful"",DZ3=""yes""),1,0)"
With Sheets("VoC Data Extract (2)")
.Range("CM3").AutoFill .Range("CM3:CM" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
When I run the macro all the cells return as #NAME ? because the formula the macro inserted look like this:
=IF(AND('AY3'="yes",'BB3'="successful",'DZ3'="yes"),1,0)
Apostrophes were added around the cells in the formula. How do I avoid this?
Thanks in advance