我测试过了,它可以正常工作。我从几个地方借鉴了一些部分。
Sub RR0() 'Replace Reset & Open dialog (specs: clear settings, search columns, match case)
'Dim r As RANGE 'not seem to need
'Set r = ActiveCell 'not seem to need
On Error Resume Next 'just in case there is no active cell
On Error GoTo 0
Application.FindFormat.Clear 'yes
Application.ReplaceFormat.Clear 'yes
Cells.find what:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext
Cells.Replace what:="", Replacement:="", ReplaceFormat:=False, MatchCase:=True 'format not seem to do anything
'Cells.Replace what:="", Replacement:="", ReplaceFormat:=False 'orig, wo matchcase not work unless put here - in replace
'If Not r Is Nothing Then r.Select 'not seem to need
'Set r = Nothing
'settings choices:
'match entire cell: LookAt:=xlWhole, or: LookAt:=xlPart,
'column or row: SearchOrder:=xlByColumns, or: SearchOrder:=xlByRows,
Application.CommandBars("Edit").Controls("Replace...").Execute 'YES WORKS
'Application.CommandBars("Edit").Controls("Find...").Execute 'YES same, easier to manipulate
'Application.CommandBars.FindControl(ID:=1849).Execute 'YES full find dialog
'PROBLEM: how to expand options?
'SendKeys ("%{T}") 'alt-T works the first time, want options to stay open
Application.EnableEvents = True 'EVENTS
End Sub