Sub SelectionReplaceTest()
Dim rSelection As Range '// 選択セル範囲
Dim r As Range '// 1セル
Dim sFind '// 検索文字列
Dim sReplace '// 置換文字列
Dim f '// Formula値
Dim v '// Value値
sFind = "aaa"
sReplace = "AAA"
Set rSelection = Selection
'// 選択セル範囲を1セルずつループ
For Each r In rSelection
f = r.Formula
v = r.Value
'// セルが数式の場合
If (Left(f, 1) = "=") And (f <> v) Then
'// 数式を置換
r.Formula = Replace(f, sFind, sReplace)
'// セルが数式でない場合
Else
'// Value値を置換
r.Value = Replace(v, sFind, sReplace)
End If
Next
End Sub