I've come to realize the Excel "Find and Replace" dialog couldn't find text in the textboxes. I think I need a macro to solve this.
How could I find text in the textboxes:
- in the active sheet
- in all sheets
Thank you.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI've come to realize the Excel "Find and Replace" dialog couldn't find text in the textboxes. I think I need a macro to solve this.
How could I find text in the textboxes:
Thank you.
Assuming you only use text fields (and no other Objects) this code should work for you (I didn't try it on Excel 2016 though):
Sub Search()
Dim shaShape As Shape
For Each shaShape In ActiveSheet.Shapes
If shaShape.DrawingObject.Text Like "*all*" Then '<== specify you're search term
shaShape.Select
Exit For
End If
Next shaShape
End Sub
You can check another solution here.
It exports all the shapes (including textboxes) to a new Word document.
In Word the search function DOES work in textboxes and the problem is solved.