エクセルネタです。
一括置き換えのマクロ。
Sub フォルダ内全ブック全シート計算式置換え()
'--- 設定事項 -----------------
Const Mypath = "C:\Desktop\" ' <--- フォルダ指定
Const OldStr = "○○○" ' <--- 置換え前
Const NewStr = "○○○" ' <--- 置換え後
'-----------------------------
Dim WB As Workbook
Dim Rng As Range
Dim FName As String
Dim Bcnt As Integer
Dim Dcnt As Integer
Dim Scnt As Integer
Dim N As Integer
Application.ScreenUpdating = False
Application.DisplayAlerts = False
FName = Dir(Mypath & "*.xls", vbNormal)
Do While FName <> ""
Set WB = Workbooks.Open(Mypath & FName)
Bcnt = Bcnt + 1
Scnt = 0
Windows(WB.Name).Visible = False
For N = 1 To WB.Worksheets.Count
Set Rng = WB.Worksheets(N).Cells.Find(OldStr)
If Not Rng Is Nothing Then
Scnt = Scnt + 1
Do
Rng.Formula = Replace(Rng.Formula, OldStr, NewStr)
Dcnt = Dcnt + 1
Set Rng = WB.Worksheets(N).Cells.FindNext(Rng)
Loop Until Rng Is Nothing
End If
Next N
If Scnt = 0 Then
WB.Close SaveChanges:=False
Else
Windows(WB.Name).Visible = True
WB.Close SaveChanges:=True
End If
FName = Dir
If FName = ThisWorkbook.FullName Then FName = Dir
Loop
Application.DisplayAlerts = True
Application.ScreenUpdating = True
If Bcnt = 0 Then
MsgBox "指定したフォルダに、ブックは見つかりませんでした。", , "検索完了"
Else
MsgBox Bcnt & " のブックを検索し " & Dcnt & " 箇所を置換えました。", , "置換え完了"
End If
Set WB = Nothing
Set Rng = Nothing
End Sub
参考までにどうぞ^^













