mdmackillop
10-26-2004, 01:01 PM
To help with this question http://www.vbaexpress.com/forum/showthread.php?t=1200
Can anyone give the code to return the text from a Textbox in Excel 2003?:help
2000 works with the following
Sub TextBoxText()
Search = InputBox("Enter Search Term")
Set MyWS = ActiveWorkbook.Sheets("Sheet1")
test = False
'Check the values in the Text Boxes here
For i = 1 To MyWS.Shapes.Count
' Debug.Print MyWS.Shapes(i).Name
BoxText = MyWS.Shapes(i).TextFrame.Characters.Text
If Left(MyWS.Shapes(i).Name, 4) = "Text" Then
If InStr(1, BoxText, Search) > 0 Then
test = True
MsgBox test
End If
End If
Next
End Sub
Can anyone give the code to return the text from a Textbox in Excel 2003?:help
2000 works with the following
Sub TextBoxText()
Search = InputBox("Enter Search Term")
Set MyWS = ActiveWorkbook.Sheets("Sheet1")
test = False
'Check the values in the Text Boxes here
For i = 1 To MyWS.Shapes.Count
' Debug.Print MyWS.Shapes(i).Name
BoxText = MyWS.Shapes(i).TextFrame.Characters.Text
If Left(MyWS.Shapes(i).Name, 4) = "Text" Then
If InStr(1, BoxText, Search) > 0 Then
test = True
MsgBox test
End If
End If
Next
End Sub