Allrighty then ... why not go the function road a bit farther!

[This is totally untested but should work as you wanted]

Code:


;debug on
break on

$oXL = CreateObject("EXCEL.application")
$oYL = CreateObject("EXCEL.application")


If @error = 0
$VS = ""
$VY = ""
$oXL.Visible = 1
$RFP = $oXL.Workbooks.Open("C:\Temp\01.xls")
$RFD = $oYL.Workbooks.Open("C:\Temp\02.xls")
$ = loop1
;$oXL.UserControl = 1
Else
Showmessage(@error + " / " @serror)
EndIf

;$oXL.quit

Function loop1
For $I=2 to 464
$ = loop2($I)
Next
EndFunction

Function loop2($I)
For $J=2 to 453
$VS = $oXL.Cells($I,3).Value
$VY = $oYL.Cells($J,1).Value
If $VS=$VY
$oXL.Cells($I,6).Value=$oYL.Cells($J,4).Value
$oXL.Cells($I,4).Value=$oYL.Cells($J,2).Value
exit 0
EndIF
Next
endfunction

Function ShowMessage($Message)
MessageBox($Message,"Attention!",4160)
EndFunction

_________________________