Я пытаюсь заменить коэффициенты в 625 уравнениях.
Я пытаюсь заменить
- x (2) на x (1)
- x(3) с x (2)
- …
- x (625) с x (624)
Вот мой код.
Sub FindReplaceAll()
Dim sht As Worksheet
Dim fnd As Variant
Dim rplc As Variant
'To Replace the x(2) with x(1) and x(2) with x(1) and .... x(625) with x(624)
For k = 2 To 625
fnd = "x(k)"
rplc = "x(k-1)"
For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace What:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows,
MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
Next k
End Sub