unanswered How To Find And Replace Text In sheet excel same CTRL+H with VBA

  • lotto009@gmail.com
  • lotto009@gmail.com's Avatar Topic Author
  • Offline
More
6 months 6 days ago #2050 by lotto009@gmail.com
Dear Sir
I  need to 
-How To Find And Replace Text In sheet excel same CTRL+H with VBA
As I find  How to find and replace text in chart titles in Excel?   about Text box and chart 
IF I need "Find And Replace Text In sheet excel same CTRL+H with VBA"
Thank you
art
This code my revise not work refer
Sub TextBoxReplace()
'Updateby20140603
Dim xWs As Worksheet
Dim xFindStr As String
Dim xReplace As String
Dim YY As String 
xFindStr = Application.InputBox("Find:", xTitleId, "", Type:=2)
xReplace = Application.InputBox("Replace:", xTitleId, "", Type:=2)
Set xWs = Application.ActiveSheet
On Error Resume Next
For 
Each  YY  In xWs.Worksheest("Sheet1").Range("A2:Z")
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
Next

Each  YY  In xWs.Worksheets("Sheet2").Range("A2:Z")
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
Next
Each  YY  In xWs.Worksheets("Sheet3").Range("A2:Z")
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
Next
Each  YY  In xWs.Worksheets("Sheet4").Range("A2:Z")
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
Next



End Sub


Please Log in or Create an account to join the conversation.

Moderators: jaychivoExcelfansqiuhongkun