crystalneedshelpplzthnx
Board Regular
- Joined
- Nov 24, 2017
- Messages
- 55
- Office Version
- 365
- Platform
- Windows
Hi All, I have been searching and changing this code and nothing has worked. I have been running the code after copying the formula as a work around. Can anyone explain what it is I am doing incorrectly. Ive tried the following:
And
I can only get it to work this way:
Which I run after copying the formula. Any help would be greatly appreciated.
Thank you
Crystal
Code:
Sub Key_Items_Validation1()
Sheets("ProductivityData MTD").Select
Range("y1").Select
ActiveCell.FormulaR1C1 = "Validation"
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter
'I have a filter and need it to also include the new column being added, so I turn it off and back on
Range("y2").Formula = "IFERROR(IF(OR(VALUE(LEFT(D2,4))=1653,VALUE(LEFT(D2,4))=1717,VALUE(LEFT(D2,4))=1802,VALUE(LEFT(D2,4))=1803,VALUE(LEFT(D2,4))=1804,VALUE(LEFT(D2,4))=1805,VALUE(LEFT(D2,4))=2659,VALUE(LEFT(D2,4))=2664,VALUE(LEFT(D2,4))=2665,VALUE(LEFT(D2,4))=2666,VALUE(LEFT(D2,4))=2667,VALUE(LEFT(D2,4))=2702,VALUE(LEFT(D2,4))=2729,VALUE(LEFT(D2,4))=2730,VALUE(LEFT(D2,4))=2731,VALUE(LEFT(D2,4))=2747,VALUE(LEFT(D2,4))=2750,VALUE(LEFT(D2,4))=2862,VALUE(LEFT(D2,4))=2863,VALUE(LEFT(D2,4))=2864,VALUE(LEFT(D2,4))=2865,VALUE(LEFT(D2,4))=2866,VALUE(LEFT(D2,4))=2867,VALUE(LEFT(D2,4))=2972),VALUE(VLOOKUP(A2&""*"",'Call Report Data MTD'!A:A,1,0))=A2,""""),""Not Found"")"
Range("y2:y" & Sheets("ProductivityData MTD").Range("A" & Rows.Count - 1).End(xlUp).Row).Select
Selection.FillDown
End Sub
And
Code:
Sub Key_Items_Validation2()Sheets("ProductivityData MTD").Select
Range("y1").Select
ActiveCell.FormulaR1C1 = "Validation"
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter
Range("y2").Select
ActiveCell.FormulaR1C1 = "=IFERROR(IF(OR(VALUE(LEFT(R[-2]C[-21],4))=1653,VALUE(LEFT(R[-2]C[-21],4))=1717,VALUE(LEFT(R[-2]C[-21],4))=1802,VALUE(LEFT(R[-2]C[-21],4))=1803,VALUE(LEFT(R[-2]C[-21],4))=1804,VALUE(LEFT(R[-2]C[-21],4))=1805,VALUE(LEFT(R[-2]C[-21],4))=2659,VALUE(LEFT(R[-2]C[-21],4))=2664,VALUE(LEFT(R[-2]C[-21],4))=2665,VALUE(LEFT(R[-2]C[-21],4))=2666,VALUE(LEFT(R[-2]C[-21],4))=2667,V" & _
"T(R[-2]C[-21],4))=2702,VALUE(LEFT(R[-2]C[-21],4))=2729,VALUE(LEFT(R[-2]C[-21],4))=2730,VALUE(LEFT(R[-2]C[-21],4))=2731,VALUE(LEFT(R[-2]C[-21],4))=2747,VALUE(LEFT(R[-2]C[-21],4))=2750,VALUE(LEFT(R[-2]C[-21],4))=2862,VALUE(LEFT(R[-2]C[-21],4))=2863,VALUE(LEFT(R[-2]C[-21],4))=2864,VALUE(LEFT(R[-2]C[-21],4))=2865,VALUE(LEFT(R[-2]C[-21],4))=2866,VALUE(LEFT(R[-2]C[-21],4)" & _
"LUE(LEFT(R[-2]C[-21],4))=2972),VALUE(VLOOKUP(R[-2]C[-24]&""*"",'Call Report Data MTD'!C[-24],1,0))=R[-2]C[-24],""""),""Not Found"")"
Range("y2:y" & Sheets("ProductivityData MTD").Range("A" & Rows.Count - 1).End(xlUp).Row).Select
Selection.FillDown
End Sub
I can only get it to work this way:
Code:
Sub Key_Items_Validation()
Sheets("ProductivityData MTD").Select
Range("y1").Select
ActiveCell.FormulaR1C1 = "Validation"
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter
Range("y2").Select
ActiveSheet.Paste
Range("y2:y" & Sheets("ProductivityData MTD").Range("A" & Rows.Count - 1).End(xlUp).Row).Select
Selection.FillDown
End Sub
Which I run after copying the formula. Any help would be greatly appreciated.
Thank you
Crystal