Dear All,
Need your help, if possible please. I am a new user using VBA.
I have large ammounts of text stored in “rectangle” boxes across my spreadsheets, as I have copied and pasted flowcharts created in another application. I am trying to use (Ctrl+F) to find text in the flowchart, however I noticed that the normal Find option doesn't work. Is there any way to perform such a search? I also tried to use the VBA code below and it could not work out as well? Any help on this is much appreciated.
Sub Findtext()
'Updateby20140603
Dim xWs As Worksheet
Dim shp As Shape
Dim xFindStr As String
Dim xReplace 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 shp In xWs.Shapes
xValue = shp.TextFrame.Characters.Text
shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
Next
End Sub
Bookmarks