|
▼kiki さん:
こんにちは!
> Sheets(S).Name.Replace "21", "22"の所で
.Replaceの使い方はRangeオブジェクトだけのような?
SheetをSelectしなくてもこのような感じでどうでしょう?
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Name = Replace(Sheets(i).Name, "21", "22")
Sheets(i).Name = Replace(Sheets(i).Name, "20", "21")
Next
完全に分岐するのでしたら、
Dim i As Integer
For i = 1 To Sheets.Count
If Sheets(i).Name Like "*21*" Then
Sheets(i).Name = Replace(Sheets(i).Name, "21", "22")
ElseIf Sheets(i).Name Like "*20*" Then
Sheets(i).Name = Replace(Sheets(i).Name, "20", "21")
End If
Next
とか?
|
|