mit diesem Macro:
'https://www.ms-office-forum.net/forum/showthread.php?t=255332
'Basiss CitizenX
Dim strFind$, myFind, firstAdd$, i&
Dim strTemp$
Dim zeil$
Dim wert() As String
strFind$ = InputBox("Bitte geben Sie die Suchbegriffe ein." & vbNewLine _
& "Trennen Sie die Suchbegriffe mit einem Schrägstrich / ", "Suche")
If strFind$ = vbNullString Then Exit Sub
For i = LBound(Split(strFind$, "/")) To UBound(Split(strFind$, "/"))
strTemp$ = Trim(Split(strFind$, "/")(i))
Set myFind = Cells.SpecialCells(xlCellTypeVisible).Find(strTemp$, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)
If Not myFind Is Nothing Then
firstAdd$ = myFind.Address
'----------------------
'----------------------------------------------
Do
If i = 0 Then Range(myFind.Address).Interior.Color = vbRed 'ich
If i = 1 Then Range(myFind.Address).Interior.Color = vbBlue 'ich
If i = 2 Then Range(myFind.Address).Interior.Color = vbGreen 'ich
If i = 3 Then Range(myFind.Address).Interior.Color = vbMagenta 'ich
If i = 4 Then Range(myFind.Address).Interior.Color = vbYellow 'ich
If i = 5 Then Range(myFind.Address).Interior.Color = vbCyan 'ich
Set myFind = Cells.SpecialCells(xlCellTypeVisible).FindNext(myFind)
Loop While myFind.Address > firstAdd$
End If
Next i
End Sub
Kann ich variable Suchkriterien in einer Msgbox eingeben und in der kompletten Tabelle suchen lassen. Alle Treffer werden dann markiert.
Ist zwar ein wenig langsam aber es funktioniert.
Da meine Tabelle sehr viele Daten hat möchte ich gern alle Zeilen ohne Treffer ausblenden.
All meine versuche schlagen fehl.
Dies ist womöglich mein bester versuch:
-----------------
'---------------
wert = Split(myFind.Address, "$") 'ich
'MsgBox "Spalte: " & wert(1) & Chr(13) & "Zeile: " & wert(2)
If myFind.Address = firstAdd$ Then
Rows(wert(2)).Hidden = True
Else
Rows(wert(2)).Hidden = False ' ich
End If
'-----------------------------------------------------
kann mir dabei jemand helfen?
mfg thomas