bk2.Activate
Application.CutCopyMode = False
bk3.Activate
Dim ccell As Integer
Dim myrow As Long
'Dim mycol As Long
'For mycol = 4 To 6
'Cells(4, mycol).Value = mycol
Dim clast As Long
clast = bk3.Range("B" & bk2.Cells.Rows.Count).End(xlUp).Row
For myrow = 3 To clast
ccell = Sheets("raw data").Range("b" & myrow).Value
Worksheets("raw data").Range("c" & myrow).Select
ActiveCell.FormulaR1C1 = "='F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R33C19"
'Worksheets("raw data").Range("mycol" & myrow).Select
'ActiveCell.FormulaR1C1 = _
"=IF(ISNA(INDEX('F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C3:R30C3,MATCH(" & mycol & ",'F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C4:R30C4,0))),"""",(INDEX('F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C3:R30C3,MATCH(" & mycol & ",'F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C4:R30C4,0))))"
'ActiveCell.FormulaR1C1 = _
"=IF(ISNA(INDEX('F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C3:R30C3,MATCH(R1C4,'F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C4:R30C4,0))),"""",(INDEX('F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C3:R30C3,MATCH(R1C4,'F:\Engineering\Michael\Excel\INVENTORY\PO\[" & ccell & ".xls]PO'!R16C4:R30C4,0))))"
Next myrow
'Next mycol