Hi all,
It could be that I've been at this for too long and I now can't see the obvious errors. I cannot get past the "object required" error - by the autofilter line- Any help will be greatly appreciated.
It could be that I've been at this for too long and I now can't see the obvious errors. I cannot get past the "object required" error - by the autofilter line- Any help will be greatly appreciated.
Code:
[I]Sub copysubpanel_NTC()[/I]
[I]Set FPNTC = Sheets("Full Panel NTC check")[/I]
[I]Set SPNTC = Sheets("Subpanel NTC check")[/I]
[I]Dim Lrow As Long[/I]
[I]With FPNTC[/I]
[I]Lrow = .Cells(Rows.Count, 1).End(xlUp).Row[/I]
[I].Range("H2:H234").FormulaR1C1 = "=IF('Patient demographics'!R2C6=""Colorectal"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-7],0)),IF('Patient demographics'!R2C6=""Breast"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-6],0)),IF('Patient demographics'!R2C6=""GIST"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-5],0)),IF('Patient demographics'!R2C6=""Glioma"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-4],0)),IF('Patient demographics'!R2C6=""HN"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-3],0)),IF('Patient demographics'!R2C6=""Lung"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-2],0)),IF('Patient demographics'!R2C6=""Melanoma"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[-1],0)),IF('Patient demographics'!R2C6=""Ovarian"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C,0)),IF('Patient demographics'!R2C6=""Prostate"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[1],0)),IF('Patient demographics'!R2C6=""Thyroid"",ISNUMBER(MATCH(C[-6], 'PanCancer Panels'!C[2],0)),FALSE))))))))))"[/I]
[B][I]FPNTC.Cells.Selection.AutoFilter.Range("A1").AutoFilter Field:=8, Criteria1:="TRUE"[/I][/B]
[I]FPNTC.Range("A2:H" & Lrow).Select[/I]
[I]Selection.Copy[/I]
[I]SPNTC.Range("A2").PasteSpecial xlPasteValues[/I]
[I]Application.CutCopyMode = False[/I]
[I]End With[/I]
[I]
[End Code].
Thank you[/I]
[I]End Sub[/I]