AW: Bestimmten Zellenwert ausblenden VBA
20.11.2008 07:57:39
Tino
Hallo,
hier mal ein Beispiel.
Kommt als Code in die entsprechende Tabelle.
Den Wirkungsbereich musst Du im Code noch anpassen, im Beispiel ist er in Spalte A bis C
Die Suchbegriffe musst Du noch anpassen und diese immer durch ein Komma trennen.
Microsoft Excel Objekt Tabelle1
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ZellBereich As Range
Dim Begriffe As String, meArea() As String
Dim i As Integer
'Anpassen***************************************
Begriffe = "F,U,AS" 'Bedingungen
Set ZellBereich = Range("A:C") 'Wirkungsbereich
'***********************************************
meArea = Split(Begriffe, ",")
With Application
.ScreenUpdating = False
.EnableEvents = False
'Schriftfarbe auf Standart
ZellBereich.Font.ColorIndex = 0
'Suche Zellen mit Begriffe
For i = Lbound(meArea) To Ubound(meArea)
Application.ReplaceFormat.Font.ColorIndex = 2
ZellBereich.Replace What:=meArea(i), Replacement:=meArea(i), LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=True
Next i
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Gruß Tino
www.VBA-Excel.de