habe ein Makro mit mehr als 3 bedingten Formatierungen.
Ist es möglich das Makro so umzuschreiben das, zb nur ein teil des textes erkannt wird und die Formatirung trotzdem erfolgt.
Stelle mir das ungefähr so vor:
DEMO-000000
Formatierung sollte jetzt erfolgen nur bei DEMO der rest soll variabel sein.
hier mal das Makro:
Option Explicit
Dim Bereich1 As Range
Private Sub Worksheet_Change(ByVal Target As Range)
Dim actCell As Range
Dim Bereich2 As Range
Set Bereich2 = Range("J10:AN51")
Application.ScreenUpdating = False
For Each actCell In Bereich1
If Not Intersect(actCell, Bereich2) Is Nothing Then
Select Case actCell
Case "": actCell.Interior.ColorIndex = 0
Case "K": actCell.Interior.ColorIndex = 3
Case "Z": actCell.Interior.ColorIndex = 4
Case "SE": actCell.Interior.ColorIndex = 16
Case "PM": actCell.Interior.ColorIndex = 6
Case "MO": actCell.Interior.ColorIndex = 7
Case "U": actCell.Interior.ColorIndex = 8
Case "S": actCell.Interior.ColorIndex = 33
Case "BL": actCell.Interior.ColorIndex = 43
End Select
End If
Next
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Bereich1 = Selection
End Sub
vorab schon mal schönen dank
Gruß Patric