[vba]

For Each w In Worksheets

lnextRow = Get_Last_Row(Sheets("rightdata").Cells)
With w

lLastRow = Get_Last_Row(.Cells)
Set headingrange = .Range(.Cells(1, 1), .Cells(lLastRow, 1))
lLastCol = headingrange.Rows(1).End(xlToRight).Column
i = 1
Do While i <= lLastCol
If headingrange(1, i) = "/summaryRecord/iacIdentifier" Then
Set CopyRange = .Range(.Cells(2, i), .Cells(lLastRow, i))
' Set CopyRange = HeadingRange((1 & lLastRow), i)

lnextRow = lnextRow + 1
CopyRange.Copy Destination:=Sheets("rightdata").Range("A" & lnextRow)
End If
Loop
End With
Next w
[/vba]