Fransenloes
Gebruiker
- Lid geworden
- 6 jan 2018
- Berichten
- 10
Hallo allemaal,
Ik heb een macro, die zoekt in een textbox op de active sheet.
Nu zou ik graag willen, dat hij alle sheets in het werkboek doorzoekt.
Alvast bedankt!
Ik heb een macro, die zoekt in een textbox op de active sheet.
Nu zou ik graag willen, dat hij alle sheets in het werkboek doorzoekt.
Alvast bedankt!
Code:
Sub FindInShape1()
Dim rStart As Range
Dim shp As Shape
Dim sFind As String
Dim sTemp As String
Dim Response
sFind = InputBox("Search for?")
If Trim(sFind) = "" Then
MsgBox "Nothing entered"
Exit Sub
End If
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 found"
End Sub