I over simplified. I am defining a range for my source data an the specific columns I want to keep along with output order. Here is a better representation of the code before I go on to apply an advanced filter criteria:
Code
Dim wb As Workbook, wsSource As Worksheet, wsTarget As Worksheet
Dim columnsToKeep() As Variant, colm As Long, v, Destn As Range, CritRangeTopLeft As Range, CritRangeBottomRight As Range, CritRange As Range
Dim lastColumnSource As Long, lastRowSource As Long, filterRange As Range
[COLOR=#FF0000]Const filterField1 As Long = 8[/COLOR]
[COLOR=#FF0000]Const filterField2 As Long = 27[/COLOR]
Const criterion1 As String = "QC-Completed"
Const criterion2 As String = vbNullString
Set wb = ThisWorkbook
Set wsSource = wb.Worksheets("Data")
Set wsTarget = wb.Worksheets("Pass On")
On Error Resume Next: wsSource.ShowAllData: On Error GoTo 0
lastRowSource = wsSource.Cells(wsSource.Rows.Count, "A").End(xlUp).Row
lastColumnSource = wsSource.Range("A1").SpecialCells(xlCellTypeLastCell).Column
Set filterRange = wsSource.Range(wsSource.Cells(1, 1), wsSource.Cells(lastRowSource, lastColumnSource))
[COLOR=#FF0000]columnsToKeep = Array(1, 13, 36, 2, 3, 24, 8, 12) [/COLOR] 'define output columns to keep and their order
'this next section puts the headers on row 1 of the Pass On sheet:
colm = 0
For Each v In columnsToKeep
colm = colm + 1
wsTarget.Cells(1, colm).Value = wsSource.Cells(1, v)
Next v
Set Destn = Range(wsTarget.Cells(1, 1), wsTarget.Cells(1, colm))
Display More
So I will need to come up with a way to derive the column numbers used in the red lines above based on the column name in row 1 rather than assuming the columns will always be in the same order.