I didn't want to stray from your code too much but when you are accessing multiple workbooks/sheets you really need to reference them by name. It makes sure the code know exactly where to apply what.
It is a little challenging for me to test this code so I hope I didn't forget anything:
Sub asdfsdf()
Dim ws1 As Worksheet: Set ws1 = ThisWorkbook.Sheets("Sheet1") 'would be best to change ThisWorkbook to be the actual workbook name and sheet name
Dim wb As Workbook
Dim rng As Range, rngSearchX As Range
Set rngSearchX = ws1.Range(ws1.Cells(1, 1), ws1.Cells(1, Columns.Count).End(xlToLeft))
For Each rng In rngSearchX.Cells
If LCase(rng.Value) = "x" Then
ws1.Range(ws1.Cells(3, rng.Column), ws1.Cells(1112, rng.Column)).Copy
Workbooks.Open ThisWorkbook.Path & Application.PathSeparator & "Purchase Order.xlsm"
Set wb = ActiveWorkbook 'acutal workbook name should go here
wb.Sheets("Sheet1").Range("D4").Paste
wb.Close True, _
ThisWorkbook.Path & Application.PathSeparator & "Column" & rng.Column & ".xlsm"
End If
Next rng
End Sub
Bookmarks