Hi guys,
I currently, have a macro to search the textboxes in my worksheet. The macro searches to find any textboxes that match the text input I am searching for.
When I find the text in a textbox, how do I scroll down to the selected textbox? Thanks.
Code
Sub FindInShape1() Dim rStart As Range
Dim shp As Shape
Dim sFind As String
Dim sTemp As String
Dim Response
Dim sRange As String
sFind = InputBox("Input text you are searching for")
If Trim(sFind) = "" Then
MsgBox "Nothing entered"
Exit Sub
End If
Set rStart = ActiveCell
For Each shp In ActiveSheet.Shapes
sTemp = shp.TextFrame.Characters.Text
If InStr(LCase(sTemp), LCase(sFind)) <> 0 Then
shp.Select
Response = MsgBox( _
prompt:=shp.Name & vbCrLf & _
sTemp & vbCrLf & vbCrLf & _
"Do you want to continue?", _
Buttons:=vbYesNo, Title:="Continue?")
If Response <> vbYes Then
Set rStart = Nothing
Exit Sub
End If
End If
Next
MsgBox "No more text found"
rStart.Select
Set rStart = Nothing
End Sub
Display More