Here is my script
Foreach ($Object in $ABC) {
try {
$Cell = ($AAA.Columns.Item($AAA_COL.'A').Find($Object.Cell,[Type]::Missing,[Type]::Missing,1)).Row
$AAA.Cells.Item($Cell,$AAA_COL.'A1') = $Object.Number1
$AAA.Cells.Item($Cell,$AAA_COL.'A2') = $Object.Number2
$AAA.Cells.Item($Cell,$AAA_COL.'A3') = $Object.Number3
$AAA.Cells.Item($Cell,$AAA_COL.'A4') = $Object.Number4
}
catch {}
$null = $Object = $Cell
}
It works but only match up the first find (YES) and skip the rest.
I have tried to do each row first but then that would take forever. This is what I use now however it takes around 20 mins to run.
Foreach ($Object in $AAA) {
try {
$Cell = $Object.Row
$AAA.Cells.Item($Cell,$AAA_COL.'A1') = ($ABC | Where-Object{$_.Number -eq $Object.A}).Number1
$AAA.Cells.Item($Cell,$AAA_COL.'A2') = ($ABC | Where-Object{$_.Number -eq $Object.A}).Number2
$AAA.Cells.Item($Cell,$AAA_COL.'A3') = ($ABC | Where-Object{$_.Number -eq $Object.A}).Number3
$AAA.Cells.Item($Cell,$AAA_COL.'A4') = ($ABC | Where-Object{$_.Number -eq $Object.A}).Number4
}
catch {}
$null = $Object = $Cell
}
Any suggestions?