HTML код:
Sub ZminaKodVsim()
Application.ScreenUpdating = False
Dim myPhrase As Range, myCell As Range, vstavkaKod As Range, poiskcell As Range, Obmen As Range, KodStajguvah As Range, RaxBorg As Range, RaxAvans As Range, Obmen1 As Range, Obmen2 As Range, Obmen3 As Range
Set myPhrase = Range("B18")
Set vstavkaKod = Range("J9")
Set KodStajguvah = Range("J12")
Set RaxBorg = Range("J13")
Set RaxAvans = Range("J14")
Workbooks.Open "D:\ðîáîòà\1\ðîáîòà\ÁÀÇÀ_ÂÏ.xlsx"
Worksheets("13_11").Activate
Set poiskcell = Workbooks("ÁÀÇÀ_ÂÏ.xlsx").Worksheets("13_11").Range("C1").Resize(Workbooks("ÁÀÇÀ_ÂÏ.xlsx").Worksheets("13_11").Range("C1").End(xlDown).Row, 1)
Set myCell = poiskcell.Find(myPhrase, LookIn:=xlValues)
If Not myCell Is Nothing Then
'MsgBox "Àäðåñ íàéäåííîé ÿ÷åéêè: " & myCell.Address
Range(myCell.Address).Select
'MsgBox "Àäðåñ àêòèâíîé ÿ÷åéêè: " & ActiveCell.Address
Set Obmen = Range(ActiveCell.Address).Offset(, 17)
Obmen.Value = vstavkaKod.Value
Set Obmen1 = Range(ActiveCell.Address).Offset(, 2)
Range(Obmen1).Select
Obmen1.Value = KodStajguvah.Value
Set Obmen2 = Range(ActiveCell.Address).Offset(, 7)
ActiveCell.Value = RaxBorg.Value
Set Obmen3 = Range(ActiveCell.Address).Offset(, 1)
ActiveCell.Value = RaxAvans.Value
Workbooks("ÁÀÇÀ_ÂÏ.xlsx").Save
Workbooks("ÁÀÇÀ_ÂÏ.xlsx").Close
Application.ScreenUpdating = True
MsgBox "Êîä çì³íåíî"
Else
MsgBox "Íå íàéäåíî"
Workbooks("ÁÀÇÀ_ÂÏ.xlsx").Close
End If
End Sub