我有这段代码,它可以正常运行。现在我需要对其进行修改,但我不知道如何操作。
该代码在整个工作表中搜索。我需要仅在1列中搜索。
该代码搜索整个单元格。我需要搜索单元格的左侧、中间或右侧。
该代码在整个工作表中搜索。我需要仅在1列中搜索。
该代码搜索整个单元格。我需要搜索单元格的左侧、中间或右侧。
Sub ChgInfo()
Dim WS As Worksheet
Dim Search As String
Dim Replacement As String
Dim Prompt As String
Dim Title As String
Dim MatchCase As Boolean
Prompt = "What is the original value you want to replace?"
Title = "Search Value Input"
Search = InputBox(Prompt, Title)
Prompt = "What is the replacement value?"
Title = "Search Value Input"
Replacement = InputBox(Prompt, Title)
For Each WS In Worksheets
WS.Cells.Replace What:=Search, Replacement:=Replacement, _
LookAt:=xlPart, MatchCase:=False
Next
End Sub