The following code will look at every workbook in a folder, search
every text box (ActiveX control textbox) on every worksheet, and
replace FindText with ReplaceText. Change the lines marked with
'<<<<< to the values you need.
Sub AAA()
Dim Folder As String
Dim FileName As String
Dim WB As Workbook
Dim WS As Worksheet
Dim OLEObj As OLEObject
Dim FindText As String
Dim ReplaceText As String
Dim S As String
Folder = "C:\Test" '<<<<< CHANGE AS NEEDED
FindText = "abc" '<<<<< CHANGE AS NEEDED
ReplaceText = "def" '<<<<< CHANGE AS NEEDED
ChDrive Folder
ChDir Folder
FileName = Dir("*.xls", vbNormal)
Do Until FileName = vbNullString
Set WB = Workbooks.Open(FileName)
For Each WS In WB.Worksheets
For Each OLEObj In WS.OLEObjects
If TypeOf OLEObj.Object Is MSForms.TextBox Then
S = Replace(OLEObj.Object.Text, _
FindText, ReplaceText)
OLEObj.Object.Text = S
End If
Next OLEObj
Next WS
WB.Close savechanges:=True
FileName = Dir()
Loop
End Sub
Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]