I'm getting "Type Mismatch" with the following code. Can someone please help?
LastRow = Cells(Rows.count, 1).End(xlUp).Row
Sheets("Sheet1").Select
Range("d2:D" & LastRow).Select
ActiveCell.formular1c1 = "=If(g2>2500,""KIRSTEN"",If(A2<""L"",""JAN"",""LEEANN""))"
With Range("D2").Value = "=If(g2>2500,""KIRSTEN"",If(A2<""L"",""JAN"",""LEEANN""))"
Selection.AutoFill Destination:=Range("D2", Cells(LastRow, "D")), Type:=xlFillDefault
End With
On the actual spreadsheet, the formula above is placing an apostrophe before and after the G2 and A2 references and producing a #NAME error. When I remove the apostrophes, the #NAME disappears and the formula works.
LastRow = Cells(Rows.count, 1).End(xlUp).Row
Sheets("Sheet1").Select
Range("d2:D" & LastRow).Select
ActiveCell.formular1c1 = "=If(g2>2500,""KIRSTEN"",If(A2<""L"",""JAN"",""LEEANN""))"
With Range("D2").Value = "=If(g2>2500,""KIRSTEN"",If(A2<""L"",""JAN"",""LEEANN""))"
Selection.AutoFill Destination:=Range("D2", Cells(LastRow, "D")), Type:=xlFillDefault
End With
On the actual spreadsheet, the formula above is placing an apostrophe before and after the G2 and A2 references and producing a #NAME error. When I remove the apostrophes, the #NAME disappears and the formula works.