[/FONT]
[FONT=Courier New]Sub LoopMyTextboxes()
Dim oleObj As OLEObject
Dim x[/FONT]
[FONT=Courier New]x = InputBox("What would you like to search in TEXTBOXES?")[/FONT]
[FONT=Courier New]For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Object.Value = x Then
MsgBox "It contain " & oleObj.Object.Value
End If
End If
Next
End Sub
[FONT=Courier New]If oleObj.Object.Value = x Then[/FONT]
[FONT=Courier New][B] 'your statement here...what do you want the code to do if 'x value is found in textbox[/B][/FONT]
[FONT=Courier New]End If[/FONT]
Sub LoopMyTextboxes()
Dim oleObj As OLEObject
Dim x
x = InputBox("What would you like to search in TEXTBOXES?")
For Each oleObj In ActiveSheet.OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Object.Value = x Then
MsgBox "The value you are looking for is in" & oleObj.Name
End If
End If
Next
End Sub
Sub FindTextinTextboxes()
Dim mt, AllDat, Shp As Shape, c
Dim oDat As String
c = 0
On Error Resume Next
oDat = Application.InputBox(prompt:="Please Enter Text/Value to Find ", Title:="Text Box Find", Type:=2)
For Each Shp In ActiveSheet.Shapes
If Shp.Type = msoTextBox Then
With ActiveSheet.Shapes(Shp.Name).TextFrame
mt = .Characters.Count
If InStr(1, .Characters(1, mt).Text, oDat, vbTextCompare) Then
AllDat = AllDat & Shp.Name & " At Position " _
& InStr(1, .Characters(1, mt).Text, oDat, vbTextCompare) _
& Chr(10)
c = c + 1
End If
End With
End If
Next Shp
If c > 0 Then
MsgBox "The Value/Text """ & oDat & """ was found in :-" & Chr(10) _
& AllDat
Else
MsgBox "No Matches Found"
End If
End Sub
Else MsgBox "No Matches Found"